From 43fc0589054b28418b7c567b024e0b6e845176ce Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 30 May 2024 15:40:58 +0200 Subject: [PATCH] hotfix(Windows Server Core LTSC2019) pin 2019 images to April version until https://github.com/microsoft/Windows-Containers/issues/493 is fixed Signed-off-by: Damien Duportal --- build-windows.yaml | 3 +++ build.ps1 | 4 +++- windows/nanoserver/Dockerfile | 3 ++- windows/windowsservercore/Dockerfile | 7 ++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build-windows.yaml b/build-windows.yaml index ddebc9c6d..5e9dcc74d 100644 --- a/build-windows.yaml +++ b/build-windows.yaml @@ -9,6 +9,7 @@ services: JAVA_VERSION: 11.0.23+9 VERSION: ${REMOTING_VERSION} WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG} + WINDOWS_VERSION_DIGEST: ${WINDOWS_VERSION_DIGEST} TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} tags: - "${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk11-${WINDOWS_FLAVOR}-${WINDOWS_VERSION_TAG}" @@ -22,6 +23,7 @@ services: JAVA_VERSION: 17.0.11+9 VERSION: ${REMOTING_VERSION} WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG} + WINDOWS_VERSION_DIGEST: ${WINDOWS_VERSION_DIGEST} TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} tags: - "${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17-${WINDOWS_FLAVOR}-${WINDOWS_VERSION_TAG}" @@ -37,6 +39,7 @@ services: JAVA_VERSION: 21.0.3+9 VERSION: ${REMOTING_VERSION} WINDOWS_VERSION_TAG: ${WINDOWS_VERSION_TAG} + WINDOWS_VERSION_DIGEST: ${WINDOWS_VERSION_DIGEST} TOOLS_WINDOWS_VERSION: ${TOOLS_WINDOWS_VERSION} tags: - "${DOCKERHUB_ORGANISATION}/${DOCKERHUB_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk21-${WINDOWS_FLAVOR}-${WINDOWS_VERSION_TAG}" diff --git a/build.ps1 b/build.ps1 index b88baaaba..3d38d7211 100644 --- a/build.ps1 +++ b/build.ps1 @@ -90,8 +90,10 @@ $env:WINDOWS_FLAVOR = $items[0] $env:WINDOWS_VERSION_TAG = $items[1] $env:TOOLS_WINDOWS_VERSION = $items[1] if ($items[1] -eq 'ltsc2019') { - # There are no eclipse-temurin:*-ltsc2019 or mcr.microsoft.com/powershell:*-ltsc2019 docker images unfortunately, only "1809" ones + # There are no mcr.microsoft.com/powershell:*-ltsc2019 docker images unfortunately, only "1809" ones $env:TOOLS_WINDOWS_VERSION = '1809' + # Workaround for 2019 only until https://github.com/microsoft/Windows-Containers/issues/493 is solved + $env:WINDOWS_VERSION_DIGEST = '@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4' } $ProgressPreference = 'SilentlyContinue' # Disable Progress bar for faster downloads diff --git a/windows/nanoserver/Dockerfile b/windows/nanoserver/Dockerfile index 4435d8366..f1b413f09 100644 --- a/windows/nanoserver/Dockerfile +++ b/windows/nanoserver/Dockerfile @@ -24,7 +24,8 @@ ARG WINDOWS_VERSION_TAG=ltsc2019 ARG TOOLS_WINDOWS_VERSION=1809 -FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}" AS jdk-core +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';"] diff --git a/windows/windowsservercore/Dockerfile b/windows/windowsservercore/Dockerfile index 3ef265fff..d819dc7d7 100644 --- a/windows/windowsservercore/Dockerfile +++ b/windows/windowsservercore/Dockerfile @@ -23,8 +23,9 @@ # THE SOFTWARE. ARG WINDOWS_VERSION_TAG=ltsc2019 -ARG TOOLS_WINDOWS_VERSION=1809 -FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}" AS jdk-core +ARG WINDOWS_VERSION_DIGEST # Empty by default +ARG TOOLS_WINDOWS_VERSION # Empty (only used on nanoserver) +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';"] @@ -39,7 +40,7 @@ RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` Remove-Item -Path C:\temp -Recurse | Out-Null ## Agent image target -FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}" AS agent +FROM mcr.microsoft.com/windows/servercore:"${WINDOWS_VERSION_TAG}${WINDOWS_VERSION_DIGEST}" AS agent ARG JAVA_HOME="C:\openjdk-17" ENV JAVA_HOME=${JAVA_HOME}