Skip to content

Commit

Permalink
Install OpenJDK 21 in ATH image (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Aug 12, 2023
1 parent 64cd2e0 commit 993880e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/resources/ath-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ RUN apt-get update && \
&& \
apt-get clean all && rm -rf /var/cache/apt

# JDK21 https://github.com/adoptium/temurin21-binaries/releases/download/jdk21-2023-08-09-06-56-beta/OpenJDK21U-jdk_aarch64_linux_hotspot_2023-08-09-06-56.tar.gz
ARG JDK21_VERSION=2023-08-09-06-56-beta
RUN curl -sSLo /tmp/jdk21.tar.gz "https://github.com/adoptium/temurin21-binaries/releases/download/jdk21-${JDK21_VERSION}/OpenJDK21U-jdk_x64_linux_hotspot_${JDK21_VERSION//-beta/}.tar.gz" \
&& mkdir /usr/lib/jvm/java-21-openjdk-amd64 \
&& tar -C /usr/lib/jvm/java-21-openjdk-amd64 -xzf /tmp/jdk21.tar.gz --strip-components=1 \
&& rm -fv /tmp/jdk21.tar.gz
RUN update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-21-openjdk-amd64/bin/java 21 \
&& update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-21-openjdk-amd64/bin/javac 21 \
&& update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java \
&& update-alternatives --set javac /usr/lib/jvm/java-17-openjdk-amd64/bin/javac

# Install a fixed firefox version that is known to work with the current selenium version, copied from https://hub.docker.com/r/selenium/node-firefox/dockerfile
ARG FIREFOX_VERSION=108.0.2
# hadolint: Do not pin packages as they are requirements only for firefox installation (and not ofr the rest of the ATH) and the effort required to track each version would be too huge
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/ath-container/set-java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if [[ $1 == '11' ]]; then
selection='11-openjdk'
elif [[ $1 == '17' ]]; then
selection='17-openjdk'
elif [[ $1 == '21' ]]; then
selection='21-openjdk'
else
echo >&2 "Unsupported java version '${1}'"
exit 1
Expand Down

0 comments on commit 993880e

Please sign in to comment.