diff --git a/Dockerfile.jre b/Dockerfile.jre index 58170be..b5c8d7e 100644 --- a/Dockerfile.jre +++ b/Dockerfile.jre @@ -8,12 +8,20 @@ FROM docker.io/rockdrilla/graalvm-debian:jdk-${JAVA_VERSION_MAJOR}-${IMAGE_VERSI FROM jdk as jdk-to-jre SHELL [ "/bin/sh", "-ec" ] +ARG JAVA_VERSION_MAJOR +## modern "jlink --compress" approach +ENV JLINK_COMPRESS='zip-1' + RUN rm -rf /jre ; \ + if [ "${JAVA_VERSION_MAJOR}" = 17 ] ; then \ + ## legacy "jlink --compress" approach + JLINK_COMPRESS='1' ; \ + fi ; \ jlink \ --add-modules ALL-MODULE-PATH \ --no-man-pages \ --no-header-files \ - --compress=1 \ + --compress=${JLINK_COMPRESS} \ --output /jre \ ; \ cd /jre ; \