diff --git a/.github/workflows/tests_docker.yml b/.github/workflows/tests_docker.yml index e78d43c473050..8bae5f8e86298 100644 --- a/.github/workflows/tests_docker.yml +++ b/.github/workflows/tests_docker.yml @@ -26,6 +26,12 @@ jobs: - docker_tag: noble docker_arch: arm64 host_os: ubuntu-22.04-arm + - docker_tag: resolute + docker_arch: amd64 + host_os: ubuntu-22.04 + - docker_tag: resolute + docker_arch: arm64 + host_os: ubuntu-22.04-arm runs-on: ${{ matrix.host_os }} permissions: id-token: write # This is required for OIDC login (azure/login) to succeed diff --git a/docs/src/docker.md b/docs/src/docker.md index 0b8bdd15119b8..608d074ecf37d 100644 --- a/docs/src/docker.md +++ b/docs/src/docker.md @@ -216,6 +216,7 @@ We currently publish images with the following tags: - `: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%%-resolute` - Playwright v%%VERSION%% release docker image based on Ubuntu 26.04 LTS (Resolute Raccoon). :::note It is recommended to always pin your Docker image to a specific version if possible. If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables. @@ -224,6 +225,7 @@ It is recommended to always pin your Docker image to a specific version if possi ### Base images We currently publish images based on the following [Ubuntu](https://hub.docker.com/_/ubuntu) versions: +- **Ubuntu 26.04 LTS** (Resolute Raccoon), image tags include `resolute` - **Ubuntu 24.04 LTS** (Noble Numbat), image tags include `noble` - **Ubuntu 22.04 LTS** (Jammy Jellyfish), image tags include `jammy` diff --git a/utils/docker/Dockerfile.resolute b/utils/docker/Dockerfile.resolute new file mode 100644 index 0000000000000..654c66edf9ed7 --- /dev/null +++ b/utils/docker/Dockerfile.resolute @@ -0,0 +1,50 @@ +FROM ubuntu:resolute + +ARG DEBIAN_FRONTEND=noninteractive +ARG TZ=America/Los_Angeles +ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright:v%version%-resolute" +ARG NODE_VERSION=24 # autogenerated via ./update-playwright-node.mjs + +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# === INSTALL Node.js === + +RUN apt-get update && \ + # Install Node.js + apt-get install -y curl wget gpg ca-certificates && \ + mkdir -p /etc/apt/keyrings && \ + curl -sL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ + echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list && \ + apt-get update && \ + apt-get install -y nodejs && \ + # Feature-parity with node.js base images. + apt-get install -y --no-install-recommends git openssh-client && \ + npm install -g yarn && \ + # clean apt cache + rm -rf /var/lib/apt/lists/* && \ + # Create the pwuser + adduser pwuser + +# === BAKE BROWSERS INTO IMAGE === + +ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright + +# 1. Add tip-of-tree Playwright package to install its browsers. +# The package should be built beforehand from tip-of-tree Playwright. +COPY ./playwright-core.tar.gz /tmp/playwright-core.tar.gz + +# 2. Bake in browsers & deps. +# Browsers will be downloaded in `/ms-playwright`. +# Note: make sure to set 777 to the registry so that any user can access +# registry. +RUN mkdir /ms-playwright && \ + mkdir /ms-playwright-agent && \ + cd /ms-playwright-agent && npm init -y && \ + npm i /tmp/playwright-core.tar.gz && \ + npm exec --no -- playwright-core mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \ + npm exec --no -- playwright-core install --with-deps && rm -rf /var/lib/apt/lists/* && \ + rm /tmp/playwright-core.tar.gz && \ + rm -rf /ms-playwright-agent && \ + rm -rf ~/.npm/ && \ + chmod -R 777 /ms-playwright diff --git a/utils/docker/build.sh b/utils/docker/build.sh index 280727eac5ce0..506950ed8e99c 100755 --- a/utils/docker/build.sh +++ b/utils/docker/build.sh @@ -3,7 +3,7 @@ set -e set +x if [[ ($1 == '--help') || ($1 == '-h') || ($1 == '') || ($2 == '') ]]; then - echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble} playwright:localbuild-noble" + echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble,resolute} playwright:localbuild-noble" echo echo "Build Playwright docker image and tag it as 'playwright:localbuild-noble'." echo "Once image is built, you can run it with" diff --git a/utils/docker/publish_docker.sh b/utils/docker/publish_docker.sh index 870da29a905a0..00d4e411a262b 100755 --- a/utils/docker/publish_docker.sh +++ b/utils/docker/publish_docker.sh @@ -32,6 +32,11 @@ NOBLE_TAGS=( "v${PW_VERSION}-noble" ) +# Ubuntu 26.04 +RESOLUTE_TAGS=( + "v${PW_VERSION}-resolute" +) + tag_and_push() { local source="$1" local target="$2" @@ -68,8 +73,10 @@ publish_docker_images_with_arch_suffix() { TAGS=("${JAMMY_TAGS[@]}") elif [[ "$FLAVOR" == "noble" ]]; then TAGS=("${NOBLE_TAGS[@]}") + elif [[ "$FLAVOR" == "resolute" ]]; then + TAGS=("${RESOLUTE_TAGS[@]}") else - echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'" + echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'" exit 1 fi local ARCH="$2" @@ -94,8 +101,10 @@ publish_docker_manifest () { TAGS=("${JAMMY_TAGS[@]}") elif [[ "$FLAVOR" == "noble" ]]; then TAGS=("${NOBLE_TAGS[@]}") + elif [[ "$FLAVOR" == "resolute" ]]; then + TAGS=("${RESOLUTE_TAGS[@]}") else - echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'" + echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'" exit 1 fi @@ -123,3 +132,8 @@ publish_docker_manifest jammy amd64 arm64 publish_docker_images_with_arch_suffix noble amd64 publish_docker_images_with_arch_suffix noble arm64 publish_docker_manifest noble amd64 arm64 + +# Ubuntu 26.04 +publish_docker_images_with_arch_suffix resolute amd64 +publish_docker_images_with_arch_suffix resolute arm64 +publish_docker_manifest resolute amd64 arm64