From 2b3396fad602013801f5c517567319f60bedb0bb Mon Sep 17 00:00:00 2001 From: Michael Weibel <307427+mweibel@users.noreply.github.com> Date: Fri, 7 May 2021 17:12:40 +0200 Subject: [PATCH] feat: configurable windows os version (#5816) allows to specify windows OS version using `--build-arg IMAGE_OS_VERSION=1909` so users can build their own argoexec using the appropriate underlying windows version (see #5367). Signed-off-by: Michael Weibel --- Dockerfile.windows | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 08621bf0b5b1..f3d793d596bf 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -3,14 +3,14 @@ # Initial stage which pulls prepares build dependencies and CLI tooling we need for our final image # Also used as the image in CI jobs so needs all dependencies #################################################################################################### + +ARG IMAGE_OS_VERSION=1809 + # had issues with official golange image for windows so I'm using plain servercore -FROM mcr.microsoft.com/windows/servercore:ltsc2019 as builder +FROM mcr.microsoft.com/windows/servercore:${IMAGE_OS_VERSION} as builder ENV GOLANG_VERSION=1.15.7 SHELL ["powershell", "-Command"] -ARG IMAGE_OS=windows -ARG IMAGE_ARCH=amd64 - # install chocolatey package manager ENV chocolateyUseWindowsCompression=false RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')); \ @@ -25,12 +25,9 @@ RUN choco install golang --version=$env:GOLANG_VERSION ; \ # argoexec-base # Used as the base for both the release and development version of argoexec #################################################################################################### -FROM mcr.microsoft.com/windows/nanoserver:1809 as argoexec-base +FROM mcr.microsoft.com/windows/nanoserver:${IMAGE_OS_VERSION} as argoexec-base COPY --from=builder /windows/system32/netapi32.dll /windows/system32/netapi32.dll -ARG IMAGE_OS=windows -ARG IMAGE_ARCH=amd64 - # NOTE: kubectl version should be one minor version less than https://storage.googleapis.com/kubernetes-release/release/stable.txt ENV KUBECTL_VERSION=1.19.6 ENV JQ_VERSION=1.6