Skip to content

Commit

Permalink
chore: bump windows jdks
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossg committed Feb 26, 2025
1 parent ee2c639 commit 40e14da
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 16 deletions.
4 changes: 2 additions & 2 deletions amazoncorretto-11-windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref

ARG zip=amazon-corretto-11-x64-windows-jdk.zip
ARG uri=https://corretto.aws/downloads/latest
ARG hash=98bef58c1d8579f0a0043cd7aeb1eb7bb0af43d71e76f977e35be1c59a6fa9c1
ARG hash=df7caf9863ac38df32a4f6c35eec9a923a8043dfcc23f44b2a02945898d29ff1

RUN Invoke-WebRequest -Uri $('{0}/{1}' -f $env:uri,$env:zip) -OutFile C:/$env:zip ; `
if((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower() -ne $env:hash) { exit 1 } ; `
Expand-Archive -Path C:/$env:zip -Destination C:/ProgramData ; `
Remove-Item C:/${env:zip}

ENV JAVA_HOME=C:/ProgramData/jdk11.0.25_9
ENV JAVA_HOME=C:/ProgramData/jdk11.0.26_4

ARG USER_HOME_DIR="C:/Users/ContainerUser"
ARG MAVEN_VERSION=3.9.9
Expand Down
12 changes: 7 additions & 5 deletions amazoncorretto-17-windowsservercore-maven-4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref

ARG zip=amazon-corretto-17-x64-windows-jdk.zip
ARG uri=https://corretto.aws/downloads/latest
ARG hash=eaacdc37c6f23753ebfae341985f11baacfaf84ca972e600803cb409c94ee8ca
ARG hash=3f3cb5c5f75978dbc60f806b74331ba4bf5a5afe155b64a83844139684f50531

RUN Invoke-WebRequest -Uri $('{0}/{1}' -f $env:uri,$env:zip) -OutFile C:/$env:zip ; `
if((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower() -ne $env:hash) { exit 1 } ; `
Expand-Archive -Path C:/$env:zip -Destination C:/ProgramData ; `
Remove-Item C:/${env:zip}
if((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower() -ne $env:hash) { `
Write-Error "Checksum for $($env:zip) does not match expected value. Expected: $($env:hash) Actual: $((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower())" ; `
exit 1 } ; `
Expand-Archive -Path C:/$env:zip -Destination C:/ProgramData ; `
Remove-Item C:/${env:zip}

ENV JAVA_HOME=C:/ProgramData/jdk17.0.13_11
ENV JAVA_HOME=C:/ProgramData/jdk17.0.14_7

ARG USER_HOME_DIR="C:/Users/ContainerUser"
ARG MAVEN_VERSION=4.0.0-rc-1
Expand Down
4 changes: 2 additions & 2 deletions amazoncorretto-17-windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref

ARG zip=amazon-corretto-17-x64-windows-jdk.zip
ARG uri=https://corretto.aws/downloads/latest
ARG hash=eaacdc37c6f23753ebfae341985f11baacfaf84ca972e600803cb409c94ee8ca
ARG hash=3f3cb5c5f75978dbc60f806b74331ba4bf5a5afe155b64a83844139684f50531

RUN Invoke-WebRequest -Uri $('{0}/{1}' -f $env:uri,$env:zip) -OutFile C:/$env:zip ; `
if((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower() -ne $env:hash) { exit 1 } ; `
Expand-Archive -Path C:/$env:zip -Destination C:/ProgramData ; `
Remove-Item C:/${env:zip}

ENV JAVA_HOME=C:/ProgramData/jdk17.0.13_11
ENV JAVA_HOME=C:/ProgramData/jdk17.0.14_7

ARG USER_HOME_DIR="C:/Users/ContainerUser"
ARG MAVEN_VERSION=3.9.9
Expand Down
4 changes: 2 additions & 2 deletions amazoncorretto-8-windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref

ARG zip=amazon-corretto-8-x64-windows-jdk.zip
ARG uri=https://corretto.aws/downloads/latest
ARG hash=f67fddbc7b0d2da6b9fb1a1b635bef4122c9030b11a1985745c279821486548b
ARG hash=63a9e2026978f1e3a1d4bb8175cab0ddfdd5b1030370c1a0d6bb5202924a1dd3

RUN Invoke-WebRequest -Uri $('{0}/{1}' -f $env:uri,$env:zip) -OutFile C:/$env:zip ; `
if((Get-FileHash C:/$env:zip -Algorithm SHA256).Hash.ToLower() -ne $env:hash) { exit 1 } ; `
Expand-Archive -Path C:/$env:zip -Destination C:/ProgramData ; `
Remove-Item C:/${env:zip}

ENV JAVA_HOME=C:/ProgramData/jdk1.8.0_432
ENV JAVA_HOME=C:/ProgramData/jdk1.8.0_442

ARG USER_HOME_DIR="C:/Users/ContainerUser"
ARG MAVEN_VERSION=3.9.9
Expand Down
20 changes: 15 additions & 5 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,25 @@ find . -iname Dockerfile -exec grep -Hl "ARG uri=" {} \; | while read -r file; d
uri=$(grep "ARG uri=" "$file" | sed -e 's/ARG uri=//')
zip=$(grep "ARG zip=" "$file" | sed -e 's/ARG zip=//')
hash=$(grep "ARG hash=" "$file" | sed -e 's/ARG hash=//')
if ! [ -f "$tmpdir/$zip" ]; then
echo "Downloading: $uri/$zip"
curl -sSLf -o "$tmpdir/$zip" "$uri/$zip"

remote_file_url="$uri/$zip"
local_file_path="$tmpdir/$zip"

# Download the file if it doesn't exist or is newer
echo "Downloading $remote_file_url"
curl -sSLf -z "$local_file_path" -o "$local_file_path.tmp" "$remote_file_url"
if [ -f "$local_file_path.tmp" ]; then
echo "Downloaded $remote_file_url"
mv "$local_file_path.tmp" "$local_file_path"
else
echo "File $local_file_path already exists and is not older than the remote file"
fi
IFS=" " read -r -a new_hash <<<"$(sha256sum "$tmpdir/$zip")"

IFS=" " read -r -a new_hash <<<"$(sha256sum "$local_file_path")"
echo "$file $uri/$zip $hash ${new_hash[0]}"
sed -i -e "s/ARG hash=.*/ARG hash=${new_hash[0]}/" "$file"
echo "Extracting JAVA_HOME from $zip"
if ! java_home="$( (unzip -t "$tmpdir/$zip" || true) | grep -m 1 "testing: " | sed -e 's#.*testing: \(.*\)/.*#\1#')"; then
if ! java_home="$( (unzip -t "$local_file_path" || true) | grep -m 1 "testing: " | sed -e 's#.*testing: \(.*\)/.*#\1#')"; then
echo >&2 "Failed to extract JAVA_HOME"
exit 1
fi
Expand Down

0 comments on commit 40e14da

Please sign in to comment.