Environment:MarketSquare Robotframework browser Docker Container
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Containerization |
| Last Updated | 2026-02-12 04:00 GMT |
Overview
Docker container environment based on the Playwright Noble image, configured with seccomp profiles and non-root user for running Browser library tests.
Description
This environment provides a containerized setup for running robotframework-browser tests in Docker. It uses the official Playwright Docker image as a base (`mcr.microsoft.com/playwright:v1.58.2-noble`), includes Python 3.12 with a virtual environment, and comes with pre-initialized browser binaries. The container requires specific security settings (seccomp profile, IPC host mode) for Chrome compatibility and must run tests as the `pwuser` non-root user.
Usage
Use this environment when running Browser library tests in CI pipelines, isolated testing environments, or when you need a reproducible container-based setup. It is particularly relevant for the Library_Development_and_Release workflow and for users who want to run tests in Docker.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Any Docker-compatible host | Linux preferred for best performance |
| Docker | Docker Engine 20+ | Required for running containers |
| Disk | ~2GB for container image | Includes browser binaries |
Dependencies
Base Image
- `mcr.microsoft.com/playwright:v1.58.2-noble` (Ubuntu Noble with Playwright pre-installed)
Container Packages
- Python 3.12 with `python3.12-venv`
- `robotframework-browser` (latest)
- Pre-initialized Playwright browser binaries
Required Docker Flags
- `--ipc=host` — Required for Chrome stability in containers
- `--security-opt seccomp=seccomp_profile.json` — Allows Chromium sandboxing syscalls
- `--user pwuser` — Run as non-root user to prevent permission issues
Credentials
The following environment variables are set in the Docker image:
- `PATH` includes `/home/pwuser/.local/bin` and `/home/pwuser/.venv/bin`
- `NODE_PATH` = `/usr/lib/node_modules`
Quick Install
# Pull the published Docker image
docker pull marketsquare/robotframework-browser:latest
# Run tests in Docker
docker run --rm \
-v $(pwd)/tests:/test \
--ipc=host \
--user pwuser \
--security-opt seccomp=seccomp_profile.json \
marketsquare/robotframework-browser:latest \
bash -c "robot --outputdir /test/output /test"
# Download the seccomp profile
wget https://raw.githubusercontent.com/microsoft/playwright/master/utils/docker/seccomp_profile.json
Code Evidence
Docker seccomp profile allowing user namespaces from `docker/seccomp_profile.json:54`:
{
"comment": "Allow create user namespaces",
"names": ["clone", "setns", "unshare"],
"action": "SCMP_ACT_ALLOW"
}
Docker run recommendation from `docker/README.md:17`:
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"
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| Chrome crashes silently in container | Missing seccomp profile | Add `--security-opt seccomp=seccomp_profile.json` to docker run |
| Permission errors on browser launch | Running as root user | Use `--user pwuser` flag |
| Shared memory errors | IPC namespace not shared | Add `--ipc=host` flag |
Compatibility Notes
- Chrome in Docker: Requires both the seccomp profile and `--ipc=host` flag for stable operation. Without these, Chrome may crash silently.
- Non-root execution: All dependencies are installed for the `pwuser` user. Running as root or other users can cause permission mismatches with browser binaries.
- ARM support: CI includes `ubuntu-24.04-arm` testing, so ARM Docker images should work.