docs: recommend Ubuntu 24.04 in Docker images (#31435)

This commit is contained in:
Max Schmitt 2024-08-12 16:39:56 +02:00 committed by GitHub
parent 0d575b4ef6
commit cae779b74f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 38 additions and 70 deletions

View File

@ -2,12 +2,6 @@ name: "publish release - Docker"
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
is_release:
required: true
type: boolean
description: "Is this a release image?"
release: release:
types: [published] types: [published]
@ -45,6 +39,3 @@ jobs:
- name: Login to ACR via OIDC - name: Login to ACR via OIDC
run: az acr login --name playwright run: az acr login --name playwright
- run: ./utils/docker/publish_docker.sh stable - 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')

View File

@ -296,7 +296,7 @@ trigger:
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright:v%%VERSION%%-jammy container: mcr.microsoft.com/playwright:v%%VERSION%%-noble
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
@ -318,7 +318,7 @@ trigger:
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy container: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble
steps: steps:
- task: UsePythonVersion@0 - task: UsePythonVersion@0
@ -340,7 +340,7 @@ trigger:
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy container: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble
steps: steps:
- task: JavaToolInstaller@0 - task: JavaToolInstaller@0
@ -361,7 +361,7 @@ trigger:
pool: pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy container: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
@ -384,28 +384,28 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors: executors:
pw-jammy-development: pw-jammy-development:
docker: docker:
- image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy - image: mcr.microsoft.com/playwright:v%%VERSION%%-noble
``` ```
```yml python ```yml python
executors: executors:
pw-jammy-development: pw-jammy-development:
docker: docker:
- image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy - image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble
``` ```
```yml java ```yml java
executors: executors:
pw-jammy-development: pw-jammy-development:
docker: docker:
- image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy - image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble
``` ```
```yml csharp ```yml csharp
executors: executors:
pw-jammy-development: pw-jammy-development:
docker: 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. 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 js ```groovy js
pipeline { pipeline {
agent { docker { image 'mcr.microsoft.com/playwright:v%%VERSION%%-jammy' } } agent { docker { image 'mcr.microsoft.com/playwright:v%%VERSION%%-noble' } }
stages { stages {
stage('e2e-tests') { stage('e2e-tests') {
steps { steps {
@ -444,7 +444,7 @@ pipeline {
```groovy python ```groovy python
pipeline { pipeline {
agent { docker { image 'mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy' } } agent { docker { image 'mcr.microsoft.com/playwright/python:v%%VERSION%%-noble' } }
stages { stages {
stage('e2e-tests') { stage('e2e-tests') {
steps { steps {
@ -458,7 +458,7 @@ pipeline {
```groovy java ```groovy java
pipeline { pipeline {
agent { docker { image 'mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy' } } agent { docker { image 'mcr.microsoft.com/playwright/java:v%%VERSION%%-noble' } }
stages { stages {
stage('e2e-tests') { stage('e2e-tests') {
steps { steps {
@ -472,7 +472,7 @@ pipeline {
```groovy csharp ```groovy csharp
pipeline { pipeline {
agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy' } } agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble' } }
stages { stages {
stage('e2e-tests') { stage('e2e-tests') {
steps { 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)). 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 ```yml js
image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright:v%%VERSION%%-noble
``` ```
```yml python ```yml python
image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble
``` ```
```yml java ```yml java
image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble
``` ```
```yml csharp ```yml csharp
image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble
``` ```
### GitLab CI ### GitLab CI
@ -514,7 +514,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright:v%%VERSION%%-noble
script: script:
... ...
``` ```
@ -525,7 +525,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/python:v%%VERSION%%-noble
script: script:
... ...
``` ```
@ -536,7 +536,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright/java:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/java:v%%VERSION%%-noble
script: script:
... ...
``` ```
@ -547,7 +547,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble
script: script:
... ...
``` ```
@ -563,7 +563,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright:v%%VERSION%%-noble
parallel: 7 parallel: 7
script: script:
- npm ci - npm ci
@ -578,7 +578,7 @@ stages:
tests: tests:
stage: test stage: test
image: mcr.microsoft.com/playwright:v%%VERSION%%-jammy image: mcr.microsoft.com/playwright:v%%VERSION%%-noble
parallel: parallel:
matrix: matrix:
- PROJECT: ['chromium', 'webkit'] - PROJECT: ['chromium', 'webkit']
@ -594,7 +594,7 @@ To run Playwright tests on Google Cloud Build, use our public Docker image ([see
```yml ```yml
steps: steps:
- name: mcr.microsoft.com/playwright:v%%VERSION%%-jammy - name: mcr.microsoft.com/playwright:v%%VERSION%%-noble
script: script:
... ...
env: env:

View File

@ -18,19 +18,19 @@ This Docker image is intended to be used for testing and development purposes on
### Pull the image ### Pull the image
```bash js ```bash js
docker pull mcr.microsoft.com/playwright:v%%VERSION%%-jammy docker pull mcr.microsoft.com/playwright:v%%VERSION%%-noble
``` ```
```bash python ```bash python
docker pull mcr.microsoft.com/playwright/python:v%%VERSION%%-jammy docker pull mcr.microsoft.com/playwright/python:v%%VERSION%%-noble
``` ```
```bash csharp ```bash csharp
docker pull mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-jammy docker pull mcr.microsoft.com/playwright/dotnet:v%%VERSION%%-noble
``` ```
```bash java ```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 ### Run the image
@ -42,19 +42,19 @@ By default, the Docker image will use the `root` user to run the browsers. This
On 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. On 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 ```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 ```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 ```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 ```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 #### Crawling and scraping
@ -62,19 +62,19 @@ docker run -it --rm --ipc=host mcr.microsoft.com/playwright/java:v%%VERSION%%-ja
On 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. On 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 ```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 ```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 ```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 ```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: [`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]. See [all available image tags].
We currently publish images with the following tags: We currently publish images with the following tags:
- `:next` - tip-of-tree image version based on Ubuntu 22.04 LTS (Jammy Jellyfish). - `:v%%VERSION%%` - Playwright v%%VERSION%% release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `: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%%-noble` - 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%%-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). - `:v%%VERSION%%-focal` - Playwright v%%VERSION%% release docker image based on Ubuntu 20.04 LTS (Focal Fossa).

View File

@ -15,11 +15,6 @@ if [[ "${RELEASE_CHANNEL}" == "stable" ]]; then
echo "ERROR: cannot publish stable docker with Playwright version '${PW_VERSION}'" echo "ERROR: cannot publish stable docker with Playwright version '${PW_VERSION}'"
exit 1 exit 1
fi fi
elif [[ "${RELEASE_CHANNEL}" == "canary" ]]; then
if [[ "${PW_VERSION}" != *-* ]]; then
echo "ERROR: cannot publish canary docker with Playwright version '${PW_VERSION}'"
exit 1
fi
else else
echo "ERROR: unknown release channel - ${RELEASE_CHANNEL}" echo "ERROR: unknown release channel - ${RELEASE_CHANNEL}"
echo "Must be either 'stable' or 'canary'" echo "Must be either 'stable' or 'canary'"
@ -28,36 +23,20 @@ fi
# Ubuntu 20.04 # Ubuntu 20.04
FOCAL_TAGS=( FOCAL_TAGS=(
"next"
"next-focal"
"v${PW_VERSION}-focal" "v${PW_VERSION}-focal"
) )
if [[ "$RELEASE_CHANNEL" == "stable" ]]; then
FOCAL_TAGS+=("focal")
fi
# Ubuntu 22.04 # Ubuntu 22.04
JAMMY_TAGS=( JAMMY_TAGS=(
"next-jammy"
"v${PW_VERSION}-jammy" "v${PW_VERSION}-jammy"
"v${PW_VERSION}"
) )
if [[ "$RELEASE_CHANNEL" == "stable" ]]; then # Ubuntu 24.04
JAMMY_TAGS+=("latest")
JAMMY_TAGS+=("jammy")
fi
NOBLE_TAGS=( NOBLE_TAGS=(
"next-noble" "v${PW_VERSION}"
"v${PW_VERSION}-noble" "v${PW_VERSION}-noble"
) )
if [[ "$RELEASE_CHANNEL" == "stable" ]]; then
NOBLE_TAGS+=("noble")
fi
tag_and_push() { tag_and_push() {
local source="$1" local source="$1"
local target="$2" local target="$2"