Public Repository

Last pushed: 20 days ago
Short Description
Short description is empty for this repo.
Full Description

Docker Image Chrome

  • To run this image for running automated screenshot tests against it:

    • For Linux Users

      docker run -it --rm --cap-add=SYS_ADMIN --net=host bettermarks/docker-image-chrome:66 chromedriver

    • For MacOS/Windows Users

      docker run -it --rm -p 9515:9515 --cap-add=SYS_ADMIN bettermarks/docker-image-chrome:66 chromedriver

  • The chrome version can be tested like this:

    docker run bettermarks/docker-image-chrome:66 google-chrome --version

  • The chromedriver version can be tested like this:

    docker run bettermarks/docker-image-chrome:66 chromedriver --version

  • Notes:
    • The above examples demonstrate, how we can override the default entry point defined in Dockerfile
    • We have added extra flag of whitelisted-ips='' to chromedriver launch command inside Dockerfile because
      • Chromedriver by default accept connections only from local network.
      • In Linux, a running container can be made part of local network by adding option --net=host.
      • This command switch is ineffective for MacOS and WindowsOS, and due to which running container is not part of the same network but belongs to a separate docker network.
      • Because of this reason, we have added whitelisted-ips='' to chromedriver, so that any local machine is able to connect to container running for this image irrespective of OS.

Testing the image

Docker Hub provides automated testing facilities through Docker Compose files:
Any files in the same folder as the Dockerfile that end with .test.yml will be considered a Compose file to be used for testing.
Docker Hub will perform a one-off execution of the sut service. This is where your test scripts are executed. Its return code is used to determine if the tests passed or failed.

(partly copied from a blog post and the related github repoabout how to do the same for more complex testing and more CI systems.)

We are using docker-hub.test.yml to add tests.

  • add some library globally, that have build time dependencies to the OS.
  • create an empty project and do some basic setup to test the folder structure works as expected

For finding libs that need dependencies you can run grep -lr 'postinstall' node_modules inside the project.

For running the tests locally that Docker Hub runs (this will report but not return the exit code of the test):

docker-compose -f docker-hub.test.yml up --build

Docker Cloud Info

  • The github repo is directly linked to using the same details as docker-hub credentials
  • Image namespace is bettermarks/docker-image-chrome:latest or given chrome version


  • Figure out to build alpine image to reduce image size.

Helpful commands to clear all images/containers

  • docker images | awk {'print $3'} | grep -vi image | xargs docker rmi -f
  • docker ps -a | awk {'print $1'} | grep -vi container | xargs docker rm
Docker Pull Command