1
0

jre: change compression ratio in favour of speed

This commit is contained in:
Konstantin Demin 2024-10-09 12:16:48 +03:00
parent 90cef9a785
commit 611ffcd15c
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0

View File

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