docker compose with selenium
Running a local setup with selenium hub with Firefox
and Google Chrome
nodes using docker-compose . Using docker-compose
makes the setup even more convenient the using the docker --link
commands. Starting and stoping the setup is just easy. Scaling up and down the number of Chrome and Firefox nodes is just a command to.
docker-compose
builds a setup based on a compose file that is a yaml file. Creating the setup file for a selenium hub with two nodes can look like this.
Selenium hub, the web ui is exposed on port 4444 on the docker server. If you are using a local setup in OS X
you can get the ip with boot2docker ip | pbcopy
.
Firefox selenium node head less
Google Chrome selenium node head less
to run the setup save it to a file named docker-compose.yml
. Stand in the same folder as the compose file. run the following command to start the setup and send it to the background. If you like to run it in foreground remove the -d
flag. If you don’t have the images docker-compose
will pull the images like normal with docker
Now lets look and see if the docker images are running
Lest assume that you like to scale the number of Firefox and Chrome nodes to two of each. You can use the scale
command with docker-compose
. The name of the nodes are used to scale up and down the number of docker instances that are running.
Now lets stop the setup. using the stop
command with docker-compose
link to docker-compose file source