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

fix: pin windowsservercore-ltsc2019 to April 2024 release #433

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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