Skip to content
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
24 changes: 12 additions & 12 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ RUN apk add --no-cache \
ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"

RUN case "$(jlink --version 2>&1)" in \
"17."*) set -- "--compress=2" ;; \
# the compression argument is different for JDK21
"21."*) set -- "--compress=zip-6" ;; \
*) 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
"17."*) set -- "--compress=2" --add-modules ALL-MODULE-PATH ;; \
"21."*) set -- "--compress=zip-6" --add-modules ALL-MODULE-PATH ;; \
# JDK 25 switches to a minimal module set for smaller images
"25"*) set -- "--compress=zip-6" --add-modules "java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec" ;; \
*) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \
esac; \
jlink \
--strip-java-debug-attributes \
"$@" \
--no-man-pages \
--no-header-files \
--output /javaruntime

# Downloading git-lfs from this intermediate stage as there is no wget/curl in the final one
ARG GIT_LFS_VERSION=3.7.1
Expand Down
24 changes: 12 additions & 12 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ ENV PATH="/opt/jdk-${JAVA_VERSION}/bin:${PATH}"
# 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" ;; \
# the compression argument is different for JDK21
"21."*) set -- "--compress=zip-6" ;; \
*) 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
"17."*) set -- "--compress=2" --add-modules ALL-MODULE-PATH ;; \
"21."*) set -- "--compress=zip-6" --add-modules ALL-MODULE-PATH ;; \
# JDK 25 switches to a minimal module set for smaller images
"25"*) set -- "--compress=zip-6" --add-modules "java.base,java.logging,java.xml,java.management,java.net.http,jdk.crypto.ec" ;; \
*) echo "ERROR: unmanaged jlink version pattern" && exit 1 ;; \
esac; \
jlink \
--strip-java-debug-attributes \
"$@" \
--no-man-pages \
--no-header-files \
--output /javaruntime

# Downloading git-lfs from this intermediate stage as there is no wget/curl in the final one
ARG GIT_LFS_VERSION=3.7.1
Expand Down
22 changes: 16 additions & 6 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ group "linux-ppc64le" {
}

variable "jdks_to_build" {
default = [17, 21, 25]
}

variable "jdks_to_build_windows" {
default = [17, 21]
}

Expand Down Expand Up @@ -71,6 +75,10 @@ variable "JAVA21_VERSION" {
default = "21.0.8_9"
}

variable "JAVA25_VERSION" {
default = "25_36"
}

variable "DEBIAN_RELEASE" {
default = "trixie-20251020"
}
Expand All @@ -92,16 +100,18 @@ function "javaversion" {
params = [jdk]
result = (equal(17, jdk)
? "${JAVA17_VERSION}"
: "${JAVA21_VERSION}")
: equal(21, jdk)
? "${JAVA21_VERSION}"
: "${JAVA25_VERSION}")
}

## Specific functions
# Return an array of Alpine platforms to use depending on the jdk passed as parameter
function "alpine_platforms" {
params = [jdk]
result = (equal(21, jdk)
? ["linux/amd64", "linux/arm64"]
: ["linux/amd64"])
result = (equal(17, jdk)
? ["linux/amd64"]
: ["linux/amd64", "linux/arm64"])
}

# Return an array of Debian platforms to use depending on the jdk passed as parameter
Expand Down Expand Up @@ -191,7 +201,7 @@ target "debian" {

target "nanoserver" {
matrix = {
jdk = jdks_to_build
jdk = jdks_to_build_windows
windows_version = windowsversions("nanoserver")
}
name = "nanoserver-${windows_version}_jdk${jdk}"
Expand All @@ -216,7 +226,7 @@ target "nanoserver" {

target "windowsservercore" {
matrix = {
jdk = jdks_to_build
jdk = jdks_to_build_windows
windows_version = windowsversions("windowsservercore")
}
name = "windowsservercore-${windows_version}_jdk${jdk}"
Expand Down