Manuals / Playwright with Python / Chapter 36
Part 5 · CI/CD & Reporting · advanced · ~40 min · Chapter 36 of 61
27. Dockerizing Playwright Tests
Official Playwright Docker image Microsoft publishes a pre-built image with browsers and all system dependencies already installed, avoiding "works on my machine" issues caused by missing OS libraries. docker run -it --rm mcr.microsoft.com/playwright/python:v1.48.0-jammy /bin/bash Pointers: The version tag (v1.48.0 here) should match your installed playwright pip package version — a mismatch betwe
Step 1 of 5
Official Playwright Docker image
Microsoft publishes a pre-built image with browsers and all system dependencies already installed, avoiding "works on my machine" issues caused by missing OS libraries. Pointers: The version tag (v1.48.0 here) should match your installed playwright Python package's expected protocol version can cause obscure failures, so pin both deliberately rather than always pulling :latest.
Try it
Run / study this snippet
docker run -it --rm mcr.microsoft.com/playwright/python:v1.48.0-jammy /bin/bashChapter learning outcomes
- Official Playwright Docker image
- WORKDIR /app
- RUN pip install -r requirements.txt
- FROM <image>
- WORKDIR, COPY, RUN, CMD (standard Dockerfile instructions)
Clear these before you leave
Side quest
27. Dockerizing Playwright Tests deliverable
Apply one idea from “Official Playwright Docker image” in a small script or note.