Skip to content

Commit f75d727

Browse files
authored
feat(docker): add Ubuntu 26.04 (Resolute Raccoon) image (#3113)
1 parent 613c3bf commit f75d727

4 files changed

Lines changed: 72 additions & 3 deletions

File tree

.github/workflows/test_docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
docker-image-variant:
2727
- jammy
2828
- noble
29+
- resolute
2930
runs-on:
3031
- ubuntu-24.04
3132
- ubuntu-24.04-arm

utils/docker/Dockerfile.resolute

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM ubuntu:resolute
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
ARG TZ=America/Los_Angeles
5+
ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/python:v%version%-resolute"
6+
7+
ENV LANG=C.UTF-8
8+
ENV LC_ALL=C.UTF-8
9+
10+
# === INSTALL Python ===
11+
12+
RUN apt-get update && \
13+
# Install Python
14+
apt-get install -y python3 curl && \
15+
# Align with upstream Python image and don't be externally managed:
16+
# https://github.com/docker-library/python/issues/948
17+
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED && \
18+
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
19+
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
20+
python get-pip.py && \
21+
rm get-pip.py && \
22+
# Feature-parity with node.js base images.
23+
apt-get install -y --no-install-recommends git openssh-client gpg && \
24+
# clean apt cache
25+
rm -rf /var/lib/apt/lists/* && \
26+
# Create the pwuser
27+
useradd -m -s /bin/bash pwuser
28+
29+
# === BAKE BROWSERS INTO IMAGE ===
30+
31+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
32+
33+
# 1. Add tip-of-tree Playwright package to install its browsers.
34+
# The package should be built beforehand from tip-of-tree Playwright.
35+
COPY ./dist/*-manylinux*.whl /tmp/
36+
37+
# 2. Bake in browsers & deps.
38+
# Browsers will be downloaded in `/ms-playwright`.
39+
# Note: make sure to set 777 to the registry so that any user can access
40+
# registry.
41+
RUN mkdir /ms-playwright && \
42+
mkdir /ms-playwright-agent && \
43+
cd /ms-playwright-agent && \
44+
pip install virtualenv && \
45+
virtualenv venv && \
46+
. venv/bin/activate && \
47+
# if its amd64 then install the manylinux1_x86_64 pip package
48+
if [ "$(uname -m)" = "x86_64" ]; then pip install /tmp/*manylinux1_x86_64*.whl; fi && \
49+
# if its arm64 then install the manylinux1_aarch64 pip package
50+
if [ "$(uname -m)" = "aarch64" ]; then pip install /tmp/*manylinux_2_17_aarch64*.whl; fi && \
51+
playwright mark-docker-image "${DOCKER_IMAGE_NAME_TEMPLATE}" && \
52+
playwright install --with-deps && rm -rf /var/lib/apt/lists/* && \
53+
rm /tmp/*.whl && \
54+
rm -rf /ms-playwright-agent && \
55+
chmod -R 777 /ms-playwright

utils/docker/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33
set +x
44

55
if [[ ($1 == '--help') || ($1 == '-h') || ($1 == '') || ($2 == '') ]]; then
6-
echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble} playwright:localbuild-noble"
6+
echo "usage: $(basename $0) {--arm64,--amd64} {jammy,noble,resolute} playwright:localbuild-noble"
77
echo
88
echo "Build Playwright docker image and tag it as 'playwright:localbuild-noble'."
99
echo "Once image is built, you can run it with"

utils/docker/publish_docker.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ NOBLE_TAGS=(
3232
"v${PW_VERSION}-noble"
3333
)
3434

35+
# Ubuntu 26.04
36+
RESOLUTE_TAGS=(
37+
"v${PW_VERSION}-resolute"
38+
)
39+
3540
tag_and_push() {
3641
local source="$1"
3742
local target="$2"
@@ -68,8 +73,10 @@ publish_docker_images_with_arch_suffix() {
6873
TAGS=("${JAMMY_TAGS[@]}")
6974
elif [[ "$FLAVOR" == "noble" ]]; then
7075
TAGS=("${NOBLE_TAGS[@]}")
76+
elif [[ "$FLAVOR" == "resolute" ]]; then
77+
TAGS=("${RESOLUTE_TAGS[@]}")
7178
else
72-
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'"
79+
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'"
7380
exit 1
7481
fi
7582
local ARCH="$2"
@@ -94,8 +101,10 @@ publish_docker_manifest () {
94101
TAGS=("${JAMMY_TAGS[@]}")
95102
elif [[ "$FLAVOR" == "noble" ]]; then
96103
TAGS=("${NOBLE_TAGS[@]}")
104+
elif [[ "$FLAVOR" == "resolute" ]]; then
105+
TAGS=("${RESOLUTE_TAGS[@]}")
97106
else
98-
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'"
107+
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'"
99108
exit 1
100109
fi
101110

@@ -122,3 +131,7 @@ publish_docker_manifest jammy amd64 arm64
122131
publish_docker_images_with_arch_suffix noble amd64
123132
publish_docker_images_with_arch_suffix noble arm64
124133
publish_docker_manifest noble amd64 arm64
134+
135+
publish_docker_images_with_arch_suffix resolute amd64
136+
publish_docker_images_with_arch_suffix resolute arm64
137+
publish_docker_manifest resolute amd64 arm64

0 commit comments

Comments
 (0)