File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ LABEL org.opencontainers.image.licenses=MIT
77
88ENV DEBIAN_FRONTEND="noninteractive"
99
10+ ARG TARGETARCH
11+
1012# Install required packages and Temurin Java LTS versions
1113RUN set -eux; \
1214 apt-get update; \
@@ -19,5 +21,16 @@ RUN set -eux; \
1921 apt-get update; \
2022 apt-get install -o APT::Keep-Downloaded-Packages="false" -y \
2123 temurin-8-jdk temurin-11-jdk temurin-17-jdk temurin-21-jdk temurin-25-jdk; \
24+ # Set Java 21 as the default version
25+ case "${TARGETARCH}" in \
26+ amd64) \
27+ update-alternatives --set java /usr/lib/jvm/temurin-21-jdk-amd64/bin/java; \
28+ update-alternatives --set javac /usr/lib/jvm/temurin-21-jdk-amd64/bin/javac; \
29+ ;; \
30+ arm64) \
31+ update-alternatives --set java /usr/lib/jvm/temurin-21-jdk-arm64/bin/java; \
32+ update-alternatives --set javac /usr/lib/jvm/temurin-21-jdk-arm64/bin/javac; \
33+ ;; \
34+ esac; \
2235 apt-get clean; \
2336 rm -rf /var/lib/apt/lists/*
You can’t perform that action at this time.
0 commit comments