From 611ffcd15cb7887a87d18ef0d44e5002b49a7cfd Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Wed, 9 Oct 2024 12:16:48 +0300 Subject: [PATCH] jre: change compression ratio in favour of speed --- Dockerfile.jre | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 ; \