Skip to content

Building your own images

Diego Molina edited this page Nov 5, 2018 · 7 revisions

These docker containers provided by SeleniumHQ are designed with the intention of you, the user, building your own images if you need more finely tuned specifications.

By default, the docker containers are released with the intention to be used right out-of-the-gate with a stable ChromeDriver version, GeckoDriver version, Firefox and Chrome versions that are copacetic.

How to

You are able to utilize our Makefile to build your own images with your own finely tuned configurations.

Before Starting

Since the Makefile is used to build all the images, we try to reduce the amount of duplicated code with the directory structure of the project. Therefore, before being able to run a docker build ... instruction, it is necessary to generate the Dockerfiles by running:

make generate_all

Specify ChromeDriver and Chrome versions

$ BUILD_ARGS="--build-arg CHROME_DRIVER_VERSION=2.23 --build-arg CHROME_VERSION=google-chrome-beta=53.0.2785.92-1" make chrome chrome_debug standalone_chrome
#=> builds all chrome images with specific versioning of ChromeDriver, and Chrome.  (NOTE: these versions specified *MUST* be compatible, otherwise you will see errors.

Specify Firefox version

$ BUILD_ARGS="--build-arg FIREFOX_VERSION=49.0.2" make firefox firefox_debug standalone_firefox
#=> builds all Firefox images with a specific version of Firefox.  (NOTE: 3.0.0 introduces GeckoDriver, and might need to be specified as well
# You can also build the Firefox images with the Nightly build
$ BUILD_ARGS="--build-arg FIREFOX_VERSION=nightly" make firefox firefox_debug standalone_firefox

Or if you want to build the images using plain old docker commands...

(for the Chrome example, bare in mind that the version needs to be available and provided by Google, and they don't keep old versions available. If you need an old version, you would need to find it from a trusted source)

$ docker build -t my-firefox-image --build-arg FIREFOX_VERSION=48.0.1 NodeFirefox
#=> build the node-firefox image with a specific firefox version.
$ docker build -t my-chrome-image --build-arg CHROME_DRIVER_VERSION=2.23 --build-arg CHROME_VERSION=google-chrome-beta=53.0.2785.92-1 NodeChrome
#=> build the node-chrome-debug image with a specific chromedriver and chrome version.

NOTE: The Selenium docker tags that are provided will be tested with appropriate versions that are compatible with one other. By building your own images with specific versions, you may run into situations where the ChromeDriver version you are using is NOT compatible with the Chrome version you are using. If you run into these issues, please do not file an issue in this repository.