Skip to content

Commit

Permalink
Use ubi9 container for Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Jan 26, 2024
1 parent 9a96236 commit a2ac5e2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions 21/rhel/ubi9/hotspot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
FROM registry.access.redhat.com/ubi9/ubi:9.3-1361 as jre-build
ARG JAVA_VERSION=21.0.2_13
ARG TARGETPLATFORM
ARG JAVA_VERSION=21.0.2_13
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-ubi9-minimal as jre-build

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN set -x; yum install -y jq wget \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | cut -d'+' -f1 | cut -d'.' -f1) \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | jq "@uri" -jRr) \
&& CONVERTED_ARCH=$(arch | sed 's/x86_64/x64/') \
&& wget --quiet https://github.com/adoptium/temurin"${JAVA_MAJOR_VERSION}"-binaries/releases/download/jdk-"${ENCODED_JAVA_VERSION}"/OpenJDK"${JAVA_MAJOR_VERSION}"U-jdk_"${CONVERTED_ARCH}"_linux_hotspot_"${JAVA_VERSION}".tar.gz
&& yum clean all \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/ \
&& rm -f /tmp/jdk.tar.gz

ENV PATH=/opt/jdk-${JAVA_VERSION}/bin:$PATH

RUN jlink \
Expand Down

0 comments on commit a2ac5e2

Please sign in to comment.