Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs(docker): add note on how to create your own (#28434)

Max Schmittda6a36062ef8
diff --git a/docs/src/docker.md b/docs/src/docker.md
index de3627f21b..b4af453699 100644
--- a/docs/src/docker.md
+++ b/docs/src/docker.md
@@ -108,12 +108,12 @@ See our [Continuous Integration guides](./ci.md) for sample configs.
See [all available image tags].
Docker images are published automatically by GitHub Actions. We currently publish images with the
-following tags (`v1.33.0` in this case is an example:):
+following tags:
- `:next` - tip-of-tree image version based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:next-jammy` - tip-of-tree image version based on Ubuntu 22.04 LTS (Jammy Jellyfish).
-- `:v1.33.0` - Playwright v1.33.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
-- `:v1.33.0-jammy` - Playwright v1.33.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
-- `:v1.33.0-focal` - Playwright v1.33.0 release docker image based on Ubuntu 20.04 LTS (Focal Fossa).
+- `:v%%VERSION%%` - Playwright v%%VERSION%% release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v%%VERSION%%-jammy` - Playwright v%%VERSION%% release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
+- `:v%%VERSION%%-focal` - Playwright v%%VERSION%% release docker image based on Ubuntu 20.04 LTS (Focal Fossa).
- `:sha-XXXXXXX` - docker image for every commit that changed
docker files or browsers, marked with a [short sha](https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#Short-SHA-1) (first 7 digits of the SHA commit).
@@ -136,7 +136,15 @@ Browser builds for Firefox and WebKit are built for the [glibc](https://en.wikip
### Build the image
-Use [`//utils/docker/build.sh`](https://github.com/microsoft/playwright/blob/main/utils/docker/build.sh) to build the image.
+To run Playwright inside Docker, you need to have Node.js, [Playwright browsers](./browsers.md#install-browsers) and [browser system dependencies](./browsers.md#install-system-dependencies) installed. See the following Dockerfile:
+
+```Dockerfile
+FROM node:20-bookworm
+
+RUN npx -y playwright@%%VERSION%% install --with-deps
+```
+
+Note: official images published to [Microsoft Artifact Registry] are built using [`//utils/docker/build.sh`](https://github.com/microsoft/playwright/blob/main/utils/docker/build.sh) script.
```txt
./utils/docker/build.sh jammy playwright:localbuild-jammy
diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js
index ada19fab09..5dccfa65f0 100755
--- a/utils/doclint/cli.js
+++ b/utils/doclint/cli.js
@@ -199,6 +199,7 @@ async function run() {
'html',
'bash',
'sh',
+ 'Dockerfile',
]);
if (!allowedCodeLangs.has(node.codeLang.split(' ')[0]))
throw new Error(`${path.relative(PROJECT_DIR, filePath)} contains code block with invalid code block language ${node.codeLang}`);