From 97150a573db13bb4df1d622a480bfb13c9cba4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= <91831478+lemeurherve@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:52:04 +0200 Subject: [PATCH] fix: set jlink compression arg to `zip-6` for Windows jdk21 image (#1864) --- windows/windowsservercore/hotspot/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/windows/windowsservercore/hotspot/Dockerfile b/windows/windowsservercore/hotspot/Dockerfile index a570ce5a04..442c532e6b 100644 --- a/windows/windowsservercore/hotspot/Dockerfile +++ b/windows/windowsservercore/hotspot/Dockerfile @@ -25,10 +25,15 @@ RUN Write-Host 'javac --version' ; javac --version ; ` RUN $version = (jlink --version) ; ` $stripJavaDebugFlags = '--strip-java-debug-attributes' ; ` + $compressArg = '--compress=2' ; ` # jlink version 11 has less features than JDK17+ if ($version.StartsWith('11')) { ` $stripJavaDebugFlags = '--strip-debug' ; ` } ` + # jlink version 11 has less features than JDK17+ + if ($version.StartsWith('21')) { ` + $compressArg = '--compress=zip-6' ; ` + } ` & jlink ` --add-modules ALL-MODULE-PATH ` $stripJavaDebugFlags `