Skip to content

Commit

Permalink
Merge pull request #433 from lemeurherve/windows-digest
Browse files Browse the repository at this point in the history
fix: pin windowsservercore-ltsc2019 to April 2024 release
  • Loading branch information
dduportal authored Jul 8, 2024
2 parents e78194d + ad8f72b commit 67d04dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
17 changes: 15 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ function "toolsversion" {
: version)
}

# Return the Windows version digest to use for windowsservercore ltsc2019 image
# TODO: workaround, to be removed when https://github.com/microsoft/Windows-Containers/issues/493 is resolved
function "windowsversiondigest" {
params = [version]
result = (equal("ltsc2019", version)
? "@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4"
: "")
}

target "alpine" {
matrix = {
jdk = jdks_to_build
Expand Down Expand Up @@ -208,7 +217,9 @@ target "nanoserver" {
JAVA_HOME = "C:/openjdk-${jdk}"
JAVA_VERSION = "${replace(javaversion(jdk), "_", "+")}"
TOOLS_WINDOWS_VERSION = "${toolsversion(windows_version)}"
WINDOWS_VERSION_TAG = windows_version
# TODO: workaround, to be removed when https://github.com/microsoft/Windows-Containers/issues/493 is resolved
WINDOWS_VERSION_DIGEST = windowsversiondigest(windows_version)
WINDOWS_VERSION_TAG = windows_version
}
tags = [
# If there is a tag, add versioned tag suffixed by the jdk
Expand All @@ -233,7 +244,9 @@ target "windowsservercore" {
JAVA_HOME = "C:/openjdk-${jdk}"
JAVA_VERSION = "${replace(javaversion(jdk), "_", "+")}"
TOOLS_WINDOWS_VERSION = "${toolsversion(windows_version)}"
WINDOWS_VERSION_TAG = windows_version
# TODO: workaround, to be removed when https://github.com/microsoft/Windows-Containers/issues/493 is resolved
WINDOWS_VERSION_DIGEST = windowsversiondigest(windows_version)
WINDOWS_VERSION_TAG = windows_version
}
tags = [
# If there is a tag, add versioned tag suffixed by the jdk
Expand Down
4 changes: 3 additions & 1 deletion windows/nanoserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

ARG WINDOWS_VERSION_TAG
ARG TOOLS_WINDOWS_VERSION
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}" AS jdk-core
# TODO: workaround, to be removed when https://github.com/microsoft/Windows-Containers/issues/493 is resolved
ARG WINDOWS_VERSION_DIGEST # Empty by default
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}${WINDOWS_VERSION_DIGEST}" AS jdk-core

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
Expand Down
6 changes: 4 additions & 2 deletions windows/windowsservercore/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

ARG WINDOWS_VERSION_TAG
ARG TOOLS_WINDOWS_VERSION
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}" AS jdk-core
# TODO: workaround, to be removed when https://github.com/microsoft/Windows-Containers/issues/493 is resolved
ARG WINDOWS_VERSION_DIGEST # Empty by default
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}${WINDOWS_VERSION_DIGEST}" AS jdk-core

# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
Expand All @@ -38,7 +40,7 @@ RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; `
$proc.WaitForExit() ; `
Remove-Item -Path C:\temp -Recurse | Out-Null

FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}"
FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}${WINDOWS_VERSION_DIGEST}"

ARG JAVA_HOME
ENV JAVA_HOME=${JAVA_HOME}
Expand Down

0 comments on commit 67d04dc

Please sign in to comment.