ARG WINDOWS_VERSION=1809
#This version confirmed to work for both github and AKS
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as servercore

# Nanoserver is missing exactly one dll that go needs. The servercore image has this dll, but
# is nearly 2GB. This has the potential to be somewhat fragile, but it is the only way I can
# find to keep the container image size small. To keep from doing this rather expensive
# multistage build every time, we build a small base image and push it to our repo
FROM mcr.microsoft.com/windows/nanoserver:$WINDOWS_VERSION

COPY --from=servercore /windows/system32/netapi32.dll /windows/system32/netapi32.dll

# certoc is required to add new certificates to the root store.
COPY --from=servercore /windows/system32/certoc.exe /windows/system32/certoc.exe

COPY windows-base-scripts/setup-certificates.cmd /setup-certificates.cmd