Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
docs: recommend Ubuntu 24.04 in Docker images (#31435)
Max Schmittcae779b74f28
diff --git a/.github/workflows/publish_release_docker.yml b/.github/workflows/publish_release_docker.ymlindex 6a9e6d85ae..4c96de8f30 100644--- a/.github/workflows/publish_release_docker.yml+++ b/.github/workflows/publish_release_docker.yml@@ -2,12 +2,6 @@ name: "publish release - Docker"on:workflow_dispatch:- inputs:- is_release:- required: true- type: boolean- description: "Is this a release image?"-release:types: [published]@@ -45,6 +39,3 @@ jobs:- name: Login to ACR via OIDCrun: az acr login --name playwright- run: ./utils/docker/publish_docker.sh stable- if: (github.event_name != 'workflow_dispatch' && !github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.is_release == 'true')- - run: ./utils/docker/publish_docker.sh canary- if: (github.event_name != 'workflow_dispatch' && github.event.release.prerelease) || (github.event_name == 'workflow_dispatch' && github.event.inputs.is_release != 'true')diff --git a/docs/src/ci.md b/docs/src/ci.mdindex 69a59a70dc..624ccfa447 100644--- a/docs/src/ci.md+++ b/docs/src/ci.md@@ -296,7 +296,7 @@ trigger:pool:vmImage: ubuntu-latest-container: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+container: mcr.microsoft.com/playwright:v%%VERSION%%-noblesteps:- task: NodeTool@0@@ -318,7 +318,7 @@ trigger:pool:vmImage: ubuntu-latest-container: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy+container: mcr.microsoft.com/playwright/python:v%%VERSION%%-noblesteps:- task: UsePythonVersion@0@@ -340,7 +340,7 @@ trigger:pool:vmImage: ubuntu-latest-container: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy+container: mcr.microsoft.com/playwright/java:v%%VERSION%%-noblesteps:- task: JavaToolInstaller@0@@ -361,7 +361,7 @@ trigger:pool:vmImage: ubuntu-latest-container: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy+container: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noblesteps:- task: UseDotNet@2@@ -384,28 +384,28 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. Inexecutors:pw-jammy-development:docker:- - image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+ - image: mcr.microsoft.com/playwright:v%%VERSION%%-noble``````yml pythonexecutors:pw-jammy-development:docker:- - image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy+ - image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble``````yml javaexecutors:pw-jammy-development:docker:- - image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy+ - image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble``````yml csharpexecutors:pw-jammy-development:docker:- - image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy+ - image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble```Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures.@@ -430,7 +430,7 @@ to run tests on Jenkins.```groovy jspipeline {- agent { docker { image 'mcr.microsoft.com/playwright:v%%VERSION%%-jammy' } }+ agent { docker { image 'mcr.microsoft.com/playwright:v%%VERSION%%-noble' } }stages {stage('e2e-tests') {steps {@@ -444,7 +444,7 @@ pipeline {```groovy pythonpipeline {- agent { docker { image 'mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy' } }+ agent { docker { image 'mcr.microsoft.com/playwright/python:v%%VERSION%%-noble' } }stages {stage('e2e-tests') {steps {@@ -458,7 +458,7 @@ pipeline {```groovy javapipeline {- agent { docker { image 'mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy' } }+ agent { docker { image 'mcr.microsoft.com/playwright/java:v%%VERSION%%-noble' } }stages {stage('e2e-tests') {steps {@@ -472,7 +472,7 @@ pipeline {```groovy csharppipeline {- agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy' } }+ agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble' } }stages {stage('e2e-tests') {steps {@@ -489,19 +489,19 @@ pipeline {Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.md)).```yml js-image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+image: mcr.microsoft.com/playwright:v%%VERSION%%-noble``````yml python-image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy+image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble``````yml java-image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy+image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble``````yml csharp-image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy+image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble```### GitLab CI@@ -514,7 +514,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright:v%%VERSION%%-noblescript:...```@@ -525,7 +525,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noblescript:...```@@ -536,7 +536,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noblescript:...```@@ -547,7 +547,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noblescript:...```@@ -563,7 +563,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright:v%%VERSION%%-nobleparallel: 7script:- npm ci@@ -578,7 +578,7 @@ stages:tests:stage: test- image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+ image: mcr.microsoft.com/playwright:v%%VERSION%%-nobleparallel:matrix:- PROJECT: ['chromium', 'webkit']@@ -594,7 +594,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see```ymlsteps:-- name: mcr.microsoft.com/playwright:v%%VERSION%%-jammy+- name: mcr.microsoft.com/playwright:v%%VERSION%%-noblescript:...env:diff --git a/docs/src/docker.md b/docs/src/docker.mdindex 0946c2f68b..665904a144 100644--- a/docs/src/docker.md+++ b/docs/src/docker.md@@ -18,19 +18,19 @@ This Docker image is intended to be used for testing and development purposes on### Pull the image```bash js-docker pull mcr.microsoft.com/playwright:v%%VERSION%%-jammy+docker pull mcr.microsoft.com/playwright:v%%VERSION%%-noble``````bash python-docker pull mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy+docker pull mcr.microsoft.com/playwright/python:v%%VERSION%%-noble``````bash csharp-docker pull mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy+docker pull mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble``````bash java-docker pull mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy+docker pull mcr.microsoft.com/playwright/java:v%%VERSION%%-noble```### Run the image@@ -42,19 +42,19 @@ By default, the Docker image will use the `root` user to run the browsers. ThisOn trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers.```bash js-docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright:v%%VERSION%%-noble /bin/bash``````bash python-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/python:v%%VERSION%%-noble /bin/bash``````bash csharp-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble /bin/bash``````bash java-docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v%%VERSION%%-noble /bin/bash```#### Crawling and scraping@@ -62,19 +62,19 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v%%VERSION%%-jaOn untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it.```bash js-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright:v%%VERSION%%-noble /bin/bash``````bash python-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/python:v%%VERSION%%-noble /bin/bash``````bash csharp-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble /bin/bash``````bash java-docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy /bin/bash+docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/java:v%%VERSION%%-noble /bin/bash```[`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions:@@ -108,9 +108,7 @@ See our [Continuous Integration guides](./ci.md) for sample configs.See [all available image tags].We currently publish images with the 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).-- `:v%%VERSION%%` - Playwright v%%VERSION%% release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).+- `:v%%VERSION%%` - Playwright v%%VERSION%% release docker image based on Ubuntu 24.04 LTS (Noble Numbat).- `:v%%VERSION%%-noble` - Playwright v%%VERSION%% release docker image based on Ubuntu 24.04 LTS (Noble Numbat).- `: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).diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.shindex a1f69e4554..a4892024a8 100755--- a/utils/docker/publish_docker.sh+++ b/utils/docker/publish_docker.sh@@ -15,11 +15,6 @@ if [[ "${RELEASE_CHANNEL}" == "stable" ]]; thenecho "ERROR: cannot publish stable docker with Playwright version '${PW_VERSION}'"exit 1fi-elif [[ "${RELEASE_CHANNEL}" == "canary" ]]; then- if [[ "${PW_VERSION}" != *-* ]]; then- echo "ERROR: cannot publish canary docker with Playwright version '${PW_VERSION}'"- exit 1- fielseecho "ERROR: unknown release channel - ${RELEASE_CHANNEL}"echo "Must be either 'stable' or 'canary'"@@ -28,36 +23,20 @@ fi# Ubuntu 20.04FOCAL_TAGS=(- "next"- "next-focal""v${PW_VERSION}-focal")-if [[ "$RELEASE_CHANNEL" == "stable" ]]; then- FOCAL_TAGS+=("focal")-fi-# Ubuntu 22.04JAMMY_TAGS=(- "next-jammy""v${PW_VERSION}-jammy"- "v${PW_VERSION}")-if [[ "$RELEASE_CHANNEL" == "stable" ]]; then- JAMMY_TAGS+=("latest")- JAMMY_TAGS+=("jammy")-fi-+# Ubuntu 24.04NOBLE_TAGS=(- "next-noble"+ "v${PW_VERSION}""v${PW_VERSION}-noble")-if [[ "$RELEASE_CHANNEL" == "stable" ]]; then- NOBLE_TAGS+=("noble")-fi-tag_and_push() {local source="$1"local target="$2"