Robotframework-browser dockerfiles

May 8, 2026 ยท View on GitHub

Dockerfile.tests is used for our own CI and docker image build flow.

Dockerfile.latest_release is used as the base to build our published docker images. See packages for latest released docker image on github packages, and dockerhub tags for latest image on dockerhub.

Example pull: docker pull marketsquare/robotframework-browser

Our published Dockerfile can be used as a base for running your own test suites inside docker.

The image comes with latest robotframework-browser and robotframework, and with pre-initialized browsers and other dependencies for running headful tests in the container.

Example usage:

docker run --rm -v $(pwd)/atest/test/:/test --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json marketsquare/robotframework-browser:latest bash -c "robot --outputdir /test/output /test"

docker run -v is used to mount the directory containing tests on the supervising machine. In this example robot output will also be output inside the test directory

When testing with chrome we recommend downloading a copy of seccomp_profile.json security settings and using the following docker run flags --ipc=host --security-opt seccomp=seccomp_profile.json for best compatibility. Explanations and the seccomp_profile.json can be found here

(Get it directly with wget https://raw.githubusercontent.com/microsoft/playwright/master/utils/docker/seccomp_profile.json )

All dependencies are installed to support running tests as pwuser in the docker image. Running tests as root or other non pwuser can cause problems.

Build docker file locally

To build docker image locally, go ./docker folder and give command

cd docker
docker build --no-cache -t tidii --file Dockerfile.latest_release .

or output to file:

cd docker
docker build --no-cache -t tidii --file Dockerfile.latest_release . > out.txt 2>&1

Run test with locally build image

docker run -v ./atest/:/home/pwuser/test  -t tidii:latest bash -c "robot --outputdir /test/output /home/pwuser/test"

To start bash in container

docker run -i  -t tidii:latest bash

Run docker pr build test

  1. Modify Dockerfile.dev_pr

COPY docker/dist/*.whl /home/pwuser/

to

COPY dist/*.whl /home/pwuser/

  1. Build Browser wheel with: invoke package
  2. Build Docker pr container

docker build -t tidii --file docker/Dockerfile.dev_pr .

  1. Run test with command below (starts the test app inside the container so localhost:7272 is reachable):
docker run \
  -v ./atest/:/home/pwuser/test \
  -v ./node/:/home/pwuser/node \
  -t tidii:latest \
  bash -lc "
    node /home/pwuser/node/dynamic-test-app/dist/server.js > /tmp/test-app.log 2>&1 &
    for i in \$(seq 1 30); do
      curl --fail --silent http://localhost:7272/dist/ > /dev/null && break
      sleep 1
    done
    robot -v SERVER:localhost:7272 --exclude no-docker-pr -L debug \
      --outputdir /home/pwuser/output /home/pwuser/test
  "

Note: The node/ directory is mounted so the container can start the demo app. Make sure node/dynamic-test-app/dist/server.js is already built (inv create-test-app) before running.