This guide shows how to build and run the template’s Docker image to execute Robot Framework tests without installing Python/Node locally.
- Base:
mcr.microsoft.com/devcontainers/python:3.13 - Installs Node.js 22, Playwright system dependencies, and project Python dependencies
- Initializes Robot Framework Browser (
rfbrowser init) - Build arg
INSTALL_DEVcontrols whether dev tools (pre-commit, Robocop, Ruff) are installed
Build minimal runtime (no dev tools):
docker build --build-arg INSTALL_DEV=false -t rf-template:runtime .Build developer image (includes dev tools from requirements-dev.txt):
docker build --build-arg INSTALL_DEV=true -t rf-template:dev .The image defaults to running the sample API tests:
docker run --rm -e HEADLESS_BROWSER=true rf-template:runtimeRun the developer image similarly:
docker run --rm -e HEADLESS_BROWSER=true rf-template:devOverride the command to run a different suite (e.g., UI tests):
docker run --rm -e HEADLESS_BROWSER=true rf-template:runtime \
robot --outputdir output tests/project_wikipedia/ui_testsMount your local workspace (optional) to persist outputs to the host:
docker run --rm -e HEADLESS_BROWSER=true \
-v "$(pwd)":/workspace \
rf-template:runtime \
robot --outputdir /workspace/output tests/project_json_placeholder/api_testsHEADLESS_BROWSER(true/false, default true)WIKIPEDIA_BASE_URL(override defaulthttps://www.wikipedia.org/)
Example:
export HEADLESS_BROWSER=true
export WIKIPEDIA_BASE_URL=https://www.wikipedia.org/- If browsers fail to launch, rebuild the image to re-run
rfbrowser initand Playwright deps. - If you built only
rf-template:dev, run that tag instead ofrf-template:runtime(or build both).