diff --git a/alpine/hotspot/Dockerfile b/alpine/hotspot/Dockerfile index 02489fd926..969496c658 100644 --- a/alpine/hotspot/Dockerfile +++ b/alpine/hotspot/Dockerfile @@ -18,19 +18,23 @@ RUN apk add --no-cache \ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" +ARG JLINK_MODULES_DEFAULT=java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec,jdk.zipfs,jdk.unsupported,jdk.charsets + # 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) RUN case "$(jlink --version 2>&1)" in \ - "17."*) set -- "--compress=2" ;; \ + "17."*) set -- "--compress=2" "--add-modules" "ALL-MODULE-PATH" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" "--add-modules" "ALL-MODULE-PATH" ;; \ + # the compression argument is different for JDK25 (early access) + "25"*) mod_list="${JLINK_MODULES:-$JLINK_MODULES_DEFAULT}"; \ + set -- "--compress=zip-6" --add-modules "$mod_list" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ --strip-java-debug-attributes \ - "$1" \ - --add-modules ALL-MODULE-PATH \ + "$@" \ --no-man-pages \ --no-header-files \ --output /javaruntime diff --git a/debian/trixie-slim/hotspot/Dockerfile b/debian/trixie-slim/hotspot/Dockerfile index 8cee525bdd..970f1f935e 100644 --- a/debian/trixie-slim/hotspot/Dockerfile +++ b/debian/trixie-slim/hotspot/Dockerfile @@ -19,19 +19,23 @@ RUN apt-get update \ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" +ARG JLINK_MODULES_DEFAULT=java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec,jdk.zipfs,jdk.unsupported,jdk.charsets + # 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) RUN case "$(jlink --version 2>&1)" in \ - "17."*) set -- "--compress=2" ;; \ + "17."*) set -- "--compress=2" "--add-modules" "ALL-MODULE-PATH" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" "--add-modules" "ALL-MODULE-PATH" ;; \ + # the compression argument is different for JDK25 (early access) + "25"*) mod_list="${JLINK_MODULES:-$JLINK_MODULES_DEFAULT}"; \ + set -- "--compress=zip-6" --add-modules "$mod_list" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ --strip-java-debug-attributes \ - "$1" \ - --add-modules ALL-MODULE-PATH \ + "$@" \ --no-man-pages \ --no-header-files \ --output /javaruntime diff --git a/debian/trixie/hotspot/Dockerfile b/debian/trixie/hotspot/Dockerfile index c6c85d3d51..20e9fcc935 100644 --- a/debian/trixie/hotspot/Dockerfile +++ b/debian/trixie/hotspot/Dockerfile @@ -19,19 +19,23 @@ RUN apt-get update \ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" +ARG JLINK_MODULES_DEFAULT=java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec,jdk.zipfs,jdk.unsupported,jdk.charsets + # 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) RUN case "$(jlink --version 2>&1)" in \ - "17."*) set -- "--compress=2" ;; \ + "17."*) set -- "--compress=2" "--add-modules" "ALL-MODULE-PATH" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" "--add-modules" "ALL-MODULE-PATH" ;; \ + # the compression argument is different for JDK25 (early access) + "25"*) mod_list="${JLINK_MODULES:-$JLINK_MODULES_DEFAULT}"; \ + set -- "--compress=zip-6" --add-modules "$mod_list" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ --strip-java-debug-attributes \ - "$1" \ - --add-modules ALL-MODULE-PATH \ + "$@" \ --no-man-pages \ --no-header-files \ --output /javaruntime diff --git a/docker-bake.hcl b/docker-bake.hcl index e0196f1dc4..43e083c06f 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -4,23 +4,31 @@ group "linux" { targets = [ "alpine_jdk17", "alpine_jdk21", + "alpine_jdk25", "debian_jdk17", "debian_jdk21", + "debian_jdk25", "debian_slim_jdk17", "debian_slim_jdk21", + "debian_slim_jdk25", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", + "rhel_ubi9_jdk25", ] } group "linux-arm64" { targets = [ "alpine_jdk21", + "alpine_jdk25", "debian_jdk17", "debian_jdk21", + "debian_jdk25", "debian_slim_jdk21", + "debian_slim_jdk25", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", + "rhel_ubi9_jdk25", ] } @@ -28,6 +36,8 @@ group "linux-s390x" { targets = [ "debian_jdk17", "debian_jdk21", + "debian_jdk25", + "debian_slim_jdk25", ] } @@ -35,8 +45,11 @@ group "linux-ppc64le" { targets = [ "debian_jdk17", "debian_jdk21", + "debian_jdk25", + "debian_slim_jdk25", "rhel_ubi9_jdk17", "rhel_ubi9_jdk21", + "rhel_ubi9_jdk25", ] } @@ -94,6 +107,10 @@ variable "JAVA21_VERSION" { default = "21.0.8_9" } +variable "JAVA25_VERSION" { + default = "25+9-ea-beta" +} + variable "TRIXIE_TAG" { default = "20250929" } @@ -316,3 +333,86 @@ target "rhel_ubi9_jdk21" { ] platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] } + +target "alpine_jdk25" { + dockerfile = "alpine/hotspot/Dockerfile" + context = "." + args = { + JENKINS_VERSION = JENKINS_VERSION + WAR_SHA = WAR_SHA + WAR_URL = war_url() + COMMIT_SHA = COMMIT_SHA + PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION + ALPINE_TAG = ALPINE_FULL_TAG + JAVA_VERSION = JAVA25_VERSION + } + tags = [ + tag(true, "alpine-jdk25"), + tag_weekly(false, "alpine-jdk25"), + tag_weekly(false, "alpine${ALPINE_SHORT_TAG}-jdk25"), + tag_lts(false, "lts-alpine-jdk25"), + ] + platforms = ["linux/amd64", "linux/arm64"] +} + +target "debian_jdk25" { + dockerfile = "debian/trixie/hotspot/Dockerfile" + context = "." + args = { + JENKINS_VERSION = JENKINS_VERSION + WAR_SHA = WAR_SHA + WAR_URL = war_url() + COMMIT_SHA = COMMIT_SHA + PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION + TRIXIE_TAG = TRIXIE_TAG + JAVA_VERSION = JAVA25_VERSION + } + tags = [ + tag(true, "jdk25"), + tag_weekly(false, "latest-jdk25"), + tag_weekly(false, "jdk25"), + tag_lts(false, "lts-jdk25"), + tag_lts(true, "lts-jdk25") + ] + platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] +} + +target "debian_slim_jdk25" { + dockerfile = "debian/trixie-slim/hotspot/Dockerfile" + context = "." + args = { + JENKINS_VERSION = JENKINS_VERSION + WAR_SHA = WAR_SHA + WAR_URL = war_url() + COMMIT_SHA = COMMIT_SHA + PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION + TRIXIE_TAG = TRIXIE_TAG + JAVA_VERSION = JAVA25_VERSION + } + tags = [ + tag(true, "slim-jdk25"), + tag_weekly(false, "slim-jdk25"), + tag_lts(false, "lts-slim-jdk25"), + ] + platforms = ["linux/amd64", "linux/arm64", "linux/s390x", "linux/ppc64le"] +} + +target "rhel_ubi9_jdk25" { + dockerfile = "rhel/ubi9/hotspot/Dockerfile" + context = "." + args = { + JENKINS_VERSION = JENKINS_VERSION + WAR_SHA = WAR_SHA + WAR_URL = war_url() + COMMIT_SHA = COMMIT_SHA + PLUGIN_CLI_VERSION = PLUGIN_CLI_VERSION + JAVA_VERSION = JAVA25_VERSION + } + tags = [ + tag(true, "rhel-ubi9-jdk25"), + tag_weekly(false, "rhel-ubi9-jdk25"), + tag_lts(false, "lts-rhel-ubi9-jdk25"), + tag_lts(true, "lts-rhel-ubi9-jdk25") + ] + platforms = ["linux/amd64", "linux/arm64", "linux/ppc64le"] +} diff --git a/rhel/ubi9/hotspot/Dockerfile b/rhel/ubi9/hotspot/Dockerfile index b88583c5f3..ea85d6c72a 100644 --- a/rhel/ubi9/hotspot/Dockerfile +++ b/rhel/ubi9/hotspot/Dockerfile @@ -16,19 +16,23 @@ RUN dnf install --disableplugin=subscription-manager --setopt=install_weak_deps= ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}" +ARG JLINK_MODULES_DEFAULT=java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec,jdk.zipfs,jdk.unsupported,jdk.charsets + # 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) RUN case "$(jlink --version 2>&1)" in \ - "17."*) set -- "--compress=2" ;; \ + "17."*) set -- "--compress=2" "--add-modules" "ALL-MODULE-PATH" ;; \ # the compression argument is different for JDK21 - "21."*) set -- "--compress=zip-6" ;; \ + "21."*) set -- "--compress=zip-6" "--add-modules" "ALL-MODULE-PATH" ;; \ + # the compression argument is different for JDK25 (early access) + "25"*) mod_list="${JLINK_MODULES:-$JLINK_MODULES_DEFAULT}"; \ + set -- "--compress=zip-6" --add-modules "$mod_list" ;; \ *) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \ esac; \ jlink \ --strip-java-debug-attributes \ - "$1" \ - --add-modules ALL-MODULE-PATH \ + "$@" \ --no-man-pages \ --no-header-files \ --output /javaruntime