Skip to content

Commit 4275ee3

Browse files
authored
feat(docker): set JAVA_HOME to openjdk 17 (#1105)
1 parent 69f81ea commit 4275ee3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

utils/docker/Dockerfile.focal

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ ARG DOCKER_IMAGE_NAME_TEMPLATE="mcr.microsoft.com/playwright/java:v%version%-foc
55
# === INSTALL JDK and Maven ===
66

77
RUN apt-get update && \
8+
# Install install jdk 17 in a separate apt-get command so that
9+
# installing maven doesn't bring in jdk 11
10+
apt-get install -y --no-install-recommends openjdk-17-jdk && \
811
apt-get install -y --no-install-recommends \
9-
openjdk-17-jdk maven \
12+
# Ubuntu 22.04 and earlier come with Maven 3.6.3 which fails with
13+
# Java 17, so we install latest Maven from Apache instead.
14+
# maven \
1015
# Install utilities required for downloading browsers
1116
curl \
1217
# Install utilities required for downloading driver
@@ -17,8 +22,12 @@ RUN apt-get update && \
1722
# Create the pwuser
1823
adduser pwuser
1924

25+
RUN VERSION=3.8.6 && \
26+
curl -o - https://dlcdn.apache.org/maven/maven-3/$VERSION/binaries/apache-maven-$VERSION-bin.tar.gz | tar zxfv - -C /opt/ && \
27+
ln -s /opt/apache-maven-$VERSION/bin/mvn /usr/local/bin/
28+
2029
ARG PW_TARGET_ARCH
21-
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-${PW_TARGET_ARCH}
30+
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-${PW_TARGET_ARCH}
2231

2332
# === BAKE BROWSERS INTO IMAGE ===
2433

0 commit comments

Comments
 (0)