devops: stop publishing Ubuntu 20.04 (#33203)

This commit is contained in:
Max Schmitt 2024-10-21 17:00:10 +02:00 committed by GitHub
parent 014577d345
commit e866e3306e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 75 deletions

View File

@ -5,7 +5,7 @@ title: "Docker"
## Introduction ## Introduction
[Dockerfile.jammy] can be used to run Playwright scripts in Docker environment. This image includes the [Playwright browsers](./browsers.md#install-browsers) and [browser system dependencies](./browsers.md#install-system-dependencies). The Playwright package/dependency is not included in the image and should be installed separately. [Dockerfile.noble] can be used to run Playwright scripts in Docker environment. This image includes the [Playwright browsers](./browsers.md#install-browsers) and [browser system dependencies](./browsers.md#install-system-dependencies). The Playwright package/dependency is not included in the image and should be installed separately.
## Usage ## Usage
@ -111,7 +111,6 @@ 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%%` - 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%%-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).
:::note :::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. 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.
@ -122,7 +121,6 @@ It is recommended to always pin your Docker image to a specific version if possi
We currently publish images based on the following [Ubuntu](https://hub.docker.com/_/ubuntu) versions: We currently publish images based on the following [Ubuntu](https://hub.docker.com/_/ubuntu) versions:
- **Ubuntu 24.04 LTS** (Noble Numbat), image tags include `noble` - **Ubuntu 24.04 LTS** (Noble Numbat), image tags include `noble`
- **Ubuntu 22.04 LTS** (Jammy Jellyfish), image tags include `jammy` - **Ubuntu 22.04 LTS** (Jammy Jellyfish), image tags include `jammy`
- **Ubuntu 20.04 LTS** (Focal Fossa), image tags include `focal`
#### Alpine #### Alpine

View File

@ -1,51 +0,0 @@
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=America/Los_Angeles
ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright:v%version%-focal"
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_20.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 Playwright Agent.
# Playwright Agent is used to bake in browsers and browser dependencies,
# and run docker server later on.
# 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

View File

@ -3,12 +3,12 @@ set -e
set +x set +x
if [[ ($1 == '--help') || ($1 == '-h') || ($1 == '') || ($2 == '') ]]; then if [[ ($1 == '--help') || ($1 == '-h') || ($1 == '') || ($2 == '') ]]; then
echo "usage: $(basename $0) {--arm64,--amd64} {focal,jammy} playwright:localbuild-focal" echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble} playwright:localbuild-noble"
echo echo
echo "Build Playwright docker image and tag it as 'playwright:localbuild-focal'." echo "Build Playwright docker image and tag it as 'playwright:localbuild-noble'."
echo "Once image is built, you can run it with" echo "Once image is built, you can run it with"
echo "" echo ""
echo " docker run --rm -it playwright:localbuild-focal /bin/bash" echo " docker run --rm -it playwright:localbuild-noble /bin/bash"
echo "" echo ""
echo "NOTE: this requires on Playwright dependencies to be installed with 'npm install'" echo "NOTE: this requires on Playwright dependencies to be installed with 'npm install'"
echo " and Playwright itself being built with 'npm run build'" echo " and Playwright itself being built with 'npm run build'"

View File

@ -21,11 +21,6 @@ else
exit 1 exit 1
fi fi
# Ubuntu 20.04
FOCAL_TAGS=(
"v${PW_VERSION}-focal"
)
# Ubuntu 22.04 # Ubuntu 22.04
JAMMY_TAGS=( JAMMY_TAGS=(
"v${PW_VERSION}-jammy" "v${PW_VERSION}-jammy"
@ -69,14 +64,12 @@ install_oras_if_needed() {
publish_docker_images_with_arch_suffix() { publish_docker_images_with_arch_suffix() {
local FLAVOR="$1" local FLAVOR="$1"
local TAGS=() local TAGS=()
if [[ "$FLAVOR" == "focal" ]]; then if [[ "$FLAVOR" == "jammy" ]]; then
TAGS=("${FOCAL_TAGS[@]}")
elif [[ "$FLAVOR" == "jammy" ]]; then
TAGS=("${JAMMY_TAGS[@]}") TAGS=("${JAMMY_TAGS[@]}")
elif [[ "$FLAVOR" == "noble" ]]; then elif [[ "$FLAVOR" == "noble" ]]; then
TAGS=("${NOBLE_TAGS[@]}") TAGS=("${NOBLE_TAGS[@]}")
else else
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'focal', 'jammy', or 'noble'" echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'"
exit 1 exit 1
fi fi
local ARCH="$2" local ARCH="$2"
@ -97,14 +90,12 @@ publish_docker_images_with_arch_suffix() {
publish_docker_manifest () { publish_docker_manifest () {
local FLAVOR="$1" local FLAVOR="$1"
local TAGS=() local TAGS=()
if [[ "$FLAVOR" == "focal" ]]; then if [[ "$FLAVOR" == "jammy" ]]; then
TAGS=("${FOCAL_TAGS[@]}")
elif [[ "$FLAVOR" == "jammy" ]]; then
TAGS=("${JAMMY_TAGS[@]}") TAGS=("${JAMMY_TAGS[@]}")
elif [[ "$FLAVOR" == "noble" ]]; then elif [[ "$FLAVOR" == "noble" ]]; then
TAGS=("${NOBLE_TAGS[@]}") TAGS=("${NOBLE_TAGS[@]}")
else else
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'focal', 'jammy', or 'noble'" echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'"
exit 1 exit 1
fi fi
@ -123,11 +114,6 @@ publish_docker_manifest () {
done done
} }
# Ubuntu 20.04
publish_docker_images_with_arch_suffix focal amd64
publish_docker_images_with_arch_suffix focal arm64
publish_docker_manifest focal amd64 arm64
# Ubuntu 22.04 # Ubuntu 22.04
publish_docker_images_with_arch_suffix jammy amd64 publish_docker_images_with_arch_suffix jammy amd64
publish_docker_images_with_arch_suffix jammy arm64 publish_docker_images_with_arch_suffix jammy arm64