Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Java 21 previews with released versions #1822

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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