Update: this information is superceded - see post from Tom below.
We’ve had quite a few people have issues getting chrome to work properly inside of their custom Docker image. I finally got a definitive way to get this to work each time.
Please add the following to your Dockerfile in order to install chrome
# Install Chrome RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
If you don’t want to run a custom image, but are using a base image that does not include chrome (assuming the base image is based on ubuntu or debian) you can also install it as a part of your build by adding the following to your
type: shell command: | wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
In order to run chrome, you need to start Xvfb (and of course it must be installed in your base image)
Export the display in your ENV section, and then start up Xvfb in the background before your browser tests start.
version: 2 executorType: docker containerInfo: - image: ubuntu:14.04 env: - DISPLAY=:99 - CHROME_BIN=/usr/bin/google-chrome - type: shell name: Starting Xvfb (for Browser Tests) command: Xvfb :99 -screen 0 1280x1024x24 background: true