Skip to content

Commit fddd7c3

Browse files
authored
feat(docker): add Ubuntu 26.04 (Resolute Raccoon) image (#1932)
1 parent 423cbf4 commit fddd7c3

4 files changed

Lines changed: 72 additions & 4 deletions

File tree

.github/workflows/test_docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
flavor: [jammy, noble]
29+
flavor: [jammy, noble, resolute]
3030
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
3131
include:
3232
- runs-on: ubuntu-24.04

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/java:v%version%-resolute"
6+
7+
ENV LANG=C.UTF-8
8+
ENV LC_ALL=C.UTF-8
9+
10+
# === INSTALL JDK and Maven ===
11+
12+
RUN apt-get update && \
13+
apt-get install -y --no-install-recommends openjdk-25-jdk \
14+
# Install utilities required for downloading browsers
15+
wget \
16+
# Install utilities required for downloading driver
17+
unzip \
18+
# For the MSEdge install script
19+
gpg && \
20+
rm -rf /var/lib/apt/lists/* && \
21+
# Create the pwuser
22+
useradd -m -s /bin/bash pwuser
23+
24+
# Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with
25+
# Java 25, so we install latest Maven from Apache instead.
26+
RUN VERSION=3.9.12 && \
27+
wget -O - https://archive.apache.org/dist/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \
28+
ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/
29+
30+
ARG PW_TARGET_ARCH
31+
ENV JAVA_HOME=/usr/lib/jvm/java-25-openjdk-${PW_TARGET_ARCH}
32+
33+
# === BAKE BROWSERS INTO IMAGE ===
34+
35+
# Browsers will remain downloaded in `/ms-playwright`.
36+
# Note: make sure to set 777 to the registry so that any user can access
37+
# registry.
38+
39+
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
40+
41+
RUN mkdir /ms-playwright && \
42+
mkdir /tmp/pw-java
43+
44+
COPY . /tmp/pw-java
45+
46+
RUN cd /tmp/pw-java && \
47+
mvn install -D skipTests --no-transfer-progress && \
48+
DEBIAN_FRONTEND=noninteractive mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \
49+
-D exec.args="install-deps" -f playwright/pom.xml --no-transfer-progress && \
50+
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \
51+
-D exec.args="install" -f playwright/pom.xml --no-transfer-progress && \
52+
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI \
53+
-D exec.args="mark-docker-image '${DOCKER_IMAGE_NAME_TEMPLATE}'" -f playwright/pom.xml --no-transfer-progress && \
54+
rm -rf /tmp/pw-java && \
55+
chmod -R 777 $PLAYWRIGHT_BROWSERS_PATH

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
@@ -38,6 +38,11 @@ NOBLE_TAGS=(
3838
"v${PW_VERSION}-noble"
3939
)
4040

41+
# Ubuntu 26.04
42+
RESOLUTE_TAGS=(
43+
"v${PW_VERSION}-resolute"
44+
)
45+
4146
tag_and_push() {
4247
local source="$1"
4348
local target="$2"
@@ -74,8 +79,10 @@ publish_docker_images_with_arch_suffix() {
7479
TAGS=("${JAMMY_TAGS[@]}")
7580
elif [[ "$FLAVOR" == "noble" ]]; then
7681
TAGS=("${NOBLE_TAGS[@]}")
82+
elif [[ "$FLAVOR" == "resolute" ]]; then
83+
TAGS=("${RESOLUTE_TAGS[@]}")
7784
else
78-
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', or 'noble'"
85+
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'"
7986
exit 1
8087
fi
8188
local ARCH="$2"
@@ -100,8 +107,10 @@ publish_docker_manifest () {
100107
TAGS=("${JAMMY_TAGS[@]}")
101108
elif [[ "$FLAVOR" == "noble" ]]; then
102109
TAGS=("${NOBLE_TAGS[@]}")
110+
elif [[ "$FLAVOR" == "resolute" ]]; then
111+
TAGS=("${RESOLUTE_TAGS[@]}")
103112
else
104-
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble'"
113+
echo "ERROR: unknown flavor - $FLAVOR. Must be either 'jammy', 'noble', or 'resolute'"
105114
exit 1
106115
fi
107116

@@ -127,3 +136,7 @@ publish_docker_manifest jammy amd64 arm64
127136
publish_docker_images_with_arch_suffix noble amd64
128137
publish_docker_images_with_arch_suffix noble arm64
129138
publish_docker_manifest noble amd64 arm64
139+
140+
publish_docker_images_with_arch_suffix resolute amd64
141+
publish_docker_images_with_arch_suffix resolute arm64
142+
publish_docker_manifest resolute amd64 arm64

0 commit comments

Comments
 (0)