Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(windows): Switch from Temurin base images to Temurin JDK binaries #1848

Merged
Merged
Changes from 73 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5b96591
chore(debian): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
b3a7d71
chore(debian): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
53810e0
chore(redhat): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
4a59ee9
chore(redhat): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
f412cb7
chore(alma): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
683bf83
chore(alpine): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
dbb5424
chore(debian): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
e99dc3d
chore(ubi9): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
634fd64
chore(alpine): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
41ad4b4
chore(debian): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
941784f
chore(debian-slim): Switch from Temurin base images to Temurin JDK bi…
gounthar Apr 16, 2024
9fe8a8e
chore(ubi9): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
2cdc09e
fix(docker): Not really needed, just for consistency.
gounthar Apr 16, 2024
c793f25
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
6627203
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
b6b7957
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
e833259
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
8ab9a71
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
205da48
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
43ff2b9
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
09c660c
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
943003b
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
2916c7e
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
6c7dee7
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
c47fffd
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
2e59f80
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
e1f72d2
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
a65e4e3
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
5735c3a
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
75026b9
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
5f10020
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
18580cd
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
c38703d
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
b967857
fix(docker): Following Damien's recommendations.
gounthar Apr 16, 2024
aa67903
Make shell script executable
gounthar Apr 16, 2024
464d694
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
cd9a57d
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
f45ce7c
fix(docker): Hadolint shellcheck.
gounthar Apr 16, 2024
bc7b699
chore(windows): Switch from Temurin base images to Temurin JDK binaries
gounthar Apr 16, 2024
11f4eb3
fix(docker): Following Damien's recommendations.
gounthar Apr 16, 2024
e3a23a2
feat(temurin): Computes the GitHub download URL thanks to the Adoptiu…
gounthar Apr 17, 2024
245541c
feat(temurin): Computes the GitHub download URL thanks to the Adoptiu…
gounthar Apr 17, 2024
172f189
fix(temurin): Uses two scripts to find the right JDK download URL.
gounthar Apr 17, 2024
f863592
fix(temurin): Better error handling.
gounthar Apr 17, 2024
060981f
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
d163d86
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
3edc9eb
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
b3ad009
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
ed67939
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
20f6f92
fix(temurin): Try to add '--allowerasing' to command line to replace …
gounthar Apr 17, 2024
a7a5a51
fix(temurin): Try to add '--allowerasing' to command line to replace …
gounthar Apr 17, 2024
61205b1
Make shell script executable
gounthar Apr 17, 2024
492b679
fix(temurin): Better handling of 307 HTTP Code.
gounthar Apr 17, 2024
36c251f
fix(docker): One less layer.
gounthar Apr 17, 2024
547eed7
fix(docker): testing mv is not so clever/necessary.
gounthar Apr 17, 2024
0e9df7a
fix(docker): Adoptium API bug workaround.
gounthar Apr 17, 2024
83dfe2c
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
15bc9b5
fix(temurin): ShellCheck suggestions.
gounthar Apr 17, 2024
b15462e
fix(temurin): Message.
gounthar Apr 17, 2024
326b9b9
fix(temurin): Message.
gounthar Apr 17, 2024
bfa3cde
fix(temurin): JAVA_VERSION is only used in the first stage.
gounthar Apr 17, 2024
f394b0c
fix(temurin): Removed debug RUN instruction.
gounthar Apr 17, 2024
b06d212
Merge pull request #2 from gounthar/from-docker-image-to-binaries
gounthar Apr 17, 2024
75cd6df
fix(temurin): Following Damien's remark.
gounthar Apr 17, 2024
e8c1394
fix(temurin): Factorize shell scripts.
gounthar Apr 17, 2024
8cd3602
fix(temurin): Factorize shell scripts.
gounthar Apr 17, 2024
e94951c
Merge pull request #3 from gounthar/from-docker-image-to-binaries-fac…
gounthar Apr 17, 2024
9c93834
fix(temurin): What was I thinking?
gounthar Apr 17, 2024
2874772
fix(temurin): URL compute simplification.
gounthar Apr 17, 2024
5a4117a
Merge pull request #4 from gounthar/from-docker-image-to-binaries-fac…
gounthar Apr 17, 2024
98a231b
Merge pull request #5 from gounthar/from-docker-image-to-binaries
gounthar Apr 18, 2024
2f9fc9d
fix(docker): Builds at last.
gounthar Apr 18, 2024
1d2a394
Merge branch 'master' into from-docker-image-to-binaries-windows
MarkEWaite Apr 20, 2024
04fee80
Update windows/windowsservercore/hotspot/Dockerfile
gounthar Apr 20, 2024
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
37 changes: 34 additions & 3 deletions windows/windowsservercore/hotspot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,45 @@
ARG JAVA_VERSION=17.0.10_7
ARG WINDOWS_VERSION=ltsc2019
ARG TOOLS_WINDOWS_VERSION=1809
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-"${TOOLS_WINDOWS_VERSION}" AS jdk-core

FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION}"
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION}" AS jre-build

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ARG JAVA_VERSION

RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; `
$javaMajorVersion = $env:JAVA_VERSION.substring(0,2) ; `
$msiUrl = 'https://api.adoptium.net/v3/installer/version/jdk-{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('_', '%2B') ; `
Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; `
MarkEWaite marked this conversation as resolved.
Show resolved Hide resolved
$proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', "INSTALLDIR=C:\openjdk-${javaMajorVersion}" -Wait -Passthru ; `
MarkEWaite marked this conversation as resolved.
Show resolved Hide resolved
$proc.WaitForExit() ; `
Remove-Item -Path C:\temp -Recurse | Out-Null

RUN Write-Host 'javac --version' ; javac --version ; `
Write-Host 'java --version' ; java --version

RUN $version = (jlink --version) ; `
$stripJavaDebugFlags = '--strip-java-debug-attributes' ; `
# jlink version 11 has less features than JDK17+
if ($version.StartsWith('11')) { `
$stripJavaDebugFlags = '--strip-debug' ; `
} `
& jlink `
--add-modules ALL-MODULE-PATH `
$stripJavaDebugFlags `
--no-man-pages `
--no-header-files `
--compress=2 `
MarkEWaite marked this conversation as resolved.
Show resolved Hide resolved
--output /javaruntime

FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION}" AS controller

ARG JAVA_HOME="C:/openjdk-17"
ENV JAVA_HOME=${JAVA_HOME}

COPY --from=jdk-core $JAVA_HOME $JAVA_HOME
COPY --from=jre-build $JAVA_HOME $JAVA_HOME
gounthar marked this conversation as resolved.
Show resolved Hide resolved

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand Down