+ All Categories
Home > Education > QA Club Kiev #20. Making life easier with Docker

QA Club Kiev #20. Making life easier with Docker

Date post: 22-Jan-2018
Category:
Upload: qa-club-kiev
View: 310 times
Download: 1 times
Share this document with a friend
21
Making life easier with Docker
Transcript
Page 1: QA Club Kiev #20. Making life easier with Docker

Making life easier with

Docker

Page 2: QA Club Kiev #20. Making life easier with Docker

What is

Docker?

Docker is the world’s leading software containerization

platform.

Page 3: QA Club Kiev #20. Making life easier with Docker

Docker vs Virtual machines

Page 4: QA Club Kiev #20. Making life easier with Docker

How Docker can help testing

- Exploration of existing Dockerfiles.

- Using dockerized tools.

- Creation of testing infrastructure based on Docker.

...you will also become more acquainted with Linux shell and shell/bash scripting.

Page 5: QA Club Kiev #20. Making life easier with Docker

Explorating existing Dockerfiles

You can find some useful information how to setup and configure some tools even by exploration of

existing Dockerfiles that can be found on Docker Hub, Github/Bitbucket inside Docker image repositories.

Page 6: QA Club Kiev #20. Making life easier with Docker

Using existing

dockerized tools

Page 7: QA Club Kiev #20. Making life easier with Docker

Advantages

● Easy installation and configuration.

● Ability to use a few different tool versions on one machine.

● Easy updating or switching between versions.

● Ability to easily switch tools between ports.

● Ability to use tools and services which aren’t supported by your OS.

Page 8: QA Club Kiev #20. Making life easier with Docker

Disadvantages

● Some functionality can work not as expected (e.g., there are some troubles in

using Docker inside dockerized Jenkins CI).

● Permissions for files created by Docker. By default, all the files and directories

created inside a Docker container and shared to host machine are owned by

Docker.

● Not all versions can be available for tools that you need.

● Some performance losses are possible on macOS and Windows systems

because of using Docker inside a virtual machine.

Page 9: QA Club Kiev #20. Making life easier with Docker

Where to search for existing tool images?

You can find existing Docker images using Docker registry:

● Docker Hub - the main Docker registry. https://hub.docker.com/

● Docker Store - place for trusted and Enterprise Ready Containers, Plugins,

and Docker Editions. https://store.docker.com/

Page 10: QA Club Kiev #20. Making life easier with Docker

Accessing dockerized tools by ports.

- Internal Docker container ports can be exposed to any free host port.

- Internal tool’s ports inside containers are to be exposed as a host machine

ports using docker run “-p” / ”-P” command options.

- Tools or services inside containers can be used through exposed ports by

calling needed port on host machine.

Page 11: QA Club Kiev #20. Making life easier with Docker

Creating your

own dockerized

tools and

services

Page 12: QA Club Kiev #20. Making life easier with Docker

Advantages

- Full control on software versions.

- Lightweight images.

- Configuration flexibility.

Disadvantages

- Can be time consuming, especially on the beginning.

- Commonly useless if you don’t need additional customization.

Page 13: QA Club Kiev #20. Making life easier with Docker

Ways of creating your own image

● Local image building and using on the same machine.

● Local image building and pushing it to Docker registry.

● Remote image building using Docker registry.

...anyway you need to start from writing a Dockerfile.

Page 14: QA Club Kiev #20. Making life easier with Docker
Page 15: QA Club Kiev #20. Making life easier with Docker

Creation of

testing

infrastructure

based on

Docker

Page 16: QA Club Kiev #20. Making life easier with Docker

Preconditions

- You need to have some CI system.

- There is a way to up project instances without human interactions on CI

system.

- It's preferable to have the whole project on docker.

- Understanding of docker-compose extending logic will be very helpful.

Page 17: QA Club Kiev #20. Making life easier with Docker

Possible docker-compose files structure.

● docker-compose.yml - basic configurations and services that are needed

for all environments.

● docker-compose.override.yml - additional configurations and services

that are commonly used for local environments.

● docker-compose.{whatever}.yml - additional configurations and

services that are needed for other environments.

Page 18: QA Club Kiev #20. Making life easier with Docker
Page 19: QA Club Kiev #20. Making life easier with Docker

Example of test environment starting command

Page 20: QA Club Kiev #20. Making life easier with Docker

Accessing services from another containers

http(s)://{name_of_service_used_in_docker-compose}:{port_inside_container}

Page 21: QA Club Kiev #20. Making life easier with Docker

Useful links:

● Docker documentation - https://docs.docker.com/manuals/

● Docker-compose documentation - https://docs.docker.com/compose/

● Docker Cookbook - http://shop.oreilly.com/product/0636920036791.do

● Docker Hub - https://hub.docker.com/

● Example of an image for Behat- https://hub.docker.com/r/bergil/docker-behat/


Recommended