diff --git a/examples/simple-game-server/Dockerfile.windows b/examples/simple-game-server/Dockerfile.windows index b20770d6e4..7eddb67920 100644 --- a/examples/simple-game-server/Dockerfile.windows +++ b/examples/simple-game-server/Dockerfile.windows @@ -19,6 +19,7 @@ # Build Stage ARG WINDOWS_VERSION=ltsc2019 +ARG IMAGE_TAG="" FROM --platform=linux/amd64 golang:1.21.6 as builder WORKDIR /go/src @@ -29,7 +30,7 @@ WORKDIR /go/src/agones.dev/agones/examples/simple-game-server RUN GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o simple-game-server.exe main.go RUN ls -ltr /go/src/agones.dev/agones/examples/simple-game-server -FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION} +FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}${IMAGE_TAG} WORKDIR / diff --git a/examples/simple-game-server/Makefile b/examples/simple-game-server/Makefile index 8004757813..d2d2bf1ac5 100644 --- a/examples/simple-game-server/Makefile +++ b/examples/simple-game-server/Makefile @@ -30,6 +30,10 @@ BUILDX_WINDOWS_BUILDER = windows-builder # For the full list of tags see https://hub.docker.com/_/microsoft-windows-servercore. # GKE-Windows version map: https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#version_mapping WINDOWS_VERSIONS = ltsc2019 ltsc2022 + +# https://github.com/microsoft/Windows-Containers/issues/493: Pin the LTSC2019 image to an older sha +LTSC2019_IMAGE_TAG = "@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4" + WINDOWS_DOCKER_PUSH_ARGS = # When pushing set to --push. # Build with Windows support WITH_WINDOWS ?= 1 @@ -108,7 +112,7 @@ push-windows-image-%: build-windows-image-%: ensure-windows-buildx cd $(root_path) && DOCKER_CLI_EXPERIMENTAL=enabled \ docker buildx build --platform windows/amd64 --builder $(BUILDX_WINDOWS_BUILDER) -f $(project_path)Dockerfile.windows \ - --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* . $(WINDOWS_DOCKER_PUSH_ARGS) + --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* --build-arg IMAGE_TAG=$(if $(filter ltsc2019,$*),$(LTSC2019_IMAGE_TAG),) . $(WINDOWS_DOCKER_PUSH_ARGS) ensure-windows-buildx: # Windows image builds must be directed to a specific buildx context. diff --git a/examples/xonotic/Dockerfile.windows b/examples/xonotic/Dockerfile.windows index 991d232b0f..6d3024ecbe 100644 --- a/examples/xonotic/Dockerfile.windows +++ b/examples/xonotic/Dockerfile.windows @@ -35,6 +35,7 @@ # See https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility # for details. ARG WINDOWS_VERSION=ltsc2019 +ARG IMAGE_TAG="" # Build Stage FROM --platform=linux/amd64 golang:1.21.6 as base @@ -53,7 +54,7 @@ RUN curl -o xonotic.zip https://dl.xonotic.org/xonotic-0.8.6.zip && \ # Final Image -FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION} +FROM mcr.microsoft.com/windows/servercore:${WINDOWS_VERSION}${IMAGE_TAG} WORKDIR C:/Xonotic diff --git a/examples/xonotic/Makefile b/examples/xonotic/Makefile index 01717cd0d5..d5eafda368 100644 --- a/examples/xonotic/Makefile +++ b/examples/xonotic/Makefile @@ -29,6 +29,9 @@ PROD_REPO ?= us-docker.pkg.dev/agones-images/examples WINDOWS_VERSIONS = ltsc2019 ltsc2022 BUILDX_WINDOWS_BUILDER = windows-builder +# https://github.com/microsoft/Windows-Containers/issues/493: Pin the LTSC2019 image to an older sha +LTSC2019_IMAGE_TAG = "@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4" + # Build with Windows support WITH_WINDOWS ?= 1 @@ -86,7 +89,7 @@ push-windows-image-%: build-windows-image-%: ensure-windows-buildx docker buildx build --platform windows/amd64 --builder $(BUILDX_WINDOWS_BUILDER) -f $(project_path)Dockerfile.windows \ - --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* . $(WINDOWS_DOCKER_PUSH_ARGS) + --tag=$(server_tag)-windows_amd64-$* --build-arg WINDOWS_VERSION=$* --build-arg IMAGE_TAG=$(if $(filter ltsc2019,$*),$(LTSC2019_IMAGE_TAG),) . $(WINDOWS_DOCKER_PUSH_ARGS) ensure-windows-buildx: # Windows image builds must be directed to a specific buildx context.