Skip to content

Commit

Permalink
Replace Java 21 previews with released versions (#1822)
Browse files Browse the repository at this point in the history
The arm/v7 support that was added as a preview has been dropped because
adoptium/adoptium-support#962 notes that the
Eclipse Temurin project does not plan to deliver arm/v7 releases after
Java 17.

Includes released versions of Java 21 for s390x and ppc64le.

Uses the Eclipse Temurin container images for the JDK download because
released versions are available for all the supported platforms.
  • Loading branch information
MarkEWaite authored Feb 6, 2024
1 parent bf37031 commit 49f4d09
Show file tree
Hide file tree
Showing 18 changed files with 126 additions and 628 deletions.
31 changes: 13 additions & 18 deletions 11/almalinux/almalinux8/hotspot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
FROM almalinux:8.9 as jre-build
ARG JAVA_VERSION=11.0.22_7

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

RUN set -x \
&& dnf -y upgrade-minimal --security \
&& dnf install -y ca-certificates jq wget \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | awk -F'.' '{print $1}') \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | tr '_' '+' | jq "@uri" -jRr) \
&& JAVA_VERSION_FILENAME=$(echo "$JAVA_VERSION" | tr '_' '+') \
&& CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \
&& 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 -O /tmp/jdk.tar.gz \
&& mkdir -p /opt/jdk-"${JAVA_VERSION_FILENAME}" \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/jdk-"${JAVA_VERSION_FILENAME}" --strip-components=1 \
&& rm -f /tmp/jdk.tar.gz \
&& export PATH=/opt/jdk-"${JAVA_VERSION_FILENAME}"/bin:$PATH \
&& jlink --add-modules ALL-MODULE-PATH --no-man-pages --compress=2 --output /javaruntime \
&& dnf clean all
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build

# Generate smaller java runtime without unneeded files
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 11 jlink
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

FROM almalinux:8.9

Expand Down
31 changes: 13 additions & 18 deletions 11/rhel/ubi8/hotspot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
FROM registry.access.redhat.com/ubi8/ubi:8.9-1107.1705420509 as jre-build
ARG JAVA_VERSION=11.0.22_7

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

RUN set -x \
&& dnf -y upgrade-minimal --security \
&& dnf install -y ca-certificates jq wget \
&& JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION" | awk -F'.' '{print $1}') \
&& ENCODED_JAVA_VERSION=$(echo "$JAVA_VERSION" | tr '_' '+' | jq "@uri" -jRr) \
&& JAVA_VERSION_FILENAME=$(echo "$JAVA_VERSION" | tr '_' '+') \
&& CONVERTED_ARCH=$(arch | sed -e 's/x86_64/x64/' -e 's/armv7l/arm/') \
&& 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 -O /tmp/jdk.tar.gz \
&& mkdir -p /opt/jdk-"${JAVA_VERSION_FILENAME}" \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/jdk-"${JAVA_VERSION_FILENAME}" --strip-components=1 \
&& rm -f /tmp/jdk.tar.gz \
&& export PATH=/opt/jdk-"${JAVA_VERSION_FILENAME}"/bin:$PATH \
&& jlink --add-modules ALL-MODULE-PATH --no-man-pages --compress=2 --output /javaruntime \
&& dnf clean all
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build

# Generate smaller java runtime without unneeded files
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 11 jlink
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

FROM registry.access.redhat.com/ubi8/ubi:8.9-1107.1705420509

Expand Down
8 changes: 2 additions & 6 deletions 17/alpine/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 17 jlink
RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \
jlink \
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-java-debug-attributes \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime; \
else \
cp -r /opt/java/openjdk /javaruntime; \
fi
--output /javaruntime

FROM alpine:"${ALPINE_TAG}" AS build

Expand Down
8 changes: 2 additions & 6 deletions 21/alpine/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-alpine AS jre-build
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 21 jlink
RUN if [ "$TARGETPLATFORM" != 'linux/arm/v7' ]; then \
jlink \
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-java-debug-attributes \
--no-man-pages \
--no-header-files \
--compress zip-6 \
--output /javaruntime; \
else \
cp -r /opt/java/openjdk /javaruntime; \
fi
--output /javaruntime

FROM alpine:"${ALPINE_TAG}" AS build

Expand Down
10 changes: 2 additions & 8 deletions 21/debian/bookworm-slim/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 21 jlink
RUN if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \
jlink \
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-java-debug-attributes \
--no-man-pages \
--no-header-files \
--compress zip-6 \
--output /javaruntime; \
# It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment.
# Because jlink fails with the error "jmods: Value too large for defined data type" error.
else \
cp -r "/opt/jdk-${JAVA_VERSION}" /javaruntime; \
fi
--output /javaruntime

FROM debian:bookworm-"${BOOKWORM_TAG}"-slim

Expand Down
157 changes: 0 additions & 157 deletions 21/debian/bookworm-slim/hotspot/preview/Dockerfile

This file was deleted.

10 changes: 2 additions & 8 deletions 21/debian/bookworm/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-jammy as jre-build
# for now we include the full module path to maintain compatibility
# while still saving space (approx 200mb from the full distribution)
# Arguments to jlink are specific to Java 21 jlink
RUN if test "${TARGETPLATFORM}" != 'linux/arm/v7'; then \
jlink \
RUN jlink \
--add-modules ALL-MODULE-PATH \
--strip-java-debug-attributes \
--no-man-pages \
--no-header-files \
--compress zip-6 \
--output /javaruntime; \
# It is acceptable to have a larger image in arm/v7 (arm 32 bits) environment.
# Because jlink fails with the error "jmods: Value too large for defined data type" error.
else \
cp -r /opt/java/openjdk /javaruntime; \
fi
--output /javaruntime

FROM debian:bookworm-"${BOOKWORM_TAG}"

Expand Down
Loading

0 comments on commit 49f4d09

Please sign in to comment.