The goal of this document to illustrate the use of docker and the Selenium project. The selenium project has released a number of containers to run various tools in the suite.

Why docker?

Running a docker container standardises the build across OS’s and removes many of the issues user may have relating to JAVA/browser version/selenium version etc.

Preparing docker on Windows

The following outlines preparing a windows 10 home installation to run docker containers.

Installing docker

Depending on your version of windows there are currently two ways of running docker. Details are given at Docker. For the version of windows Being used in this vignette (win 10 home) the older Docker toolbox is what we are going to use to run containers.

Download the .exe for Docker toolbox and begin the install. Follow the instructions on the toolbox install windows page.

Clicking on the Docker Quickstart terminal link should eventually give you a terminal that resembles the following:

Preparing docker on Linux

The following outlines preparing a ubuntu 16.04 installation to run docker containers.

Installing docker

For a general guide for various Linux distros see Docker

Ubuntu 16.04

Run system update firstly

$ sudo apt-get update

Add the official Docker GPG key to your system

$ sudo apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Add the Docker repository to APT sources:

$ echo "deb ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list

Update the package database:

sudo apt-get update

Now you should be able to install Docker

sudo apt-get install -y docker-engine

Start the docker daemon.

$ sudo service docker start

You can check that the Docker is working by running a test container:

For now run as sudo

$ sudo docker run hello-world

Running without sudo

If you want to run docker without sudo you can create a docker group and add the appropriate user to that group see Docker.

Using Selenium Docker images

The official docker repository can be viewed here at Docker Hub.