From 3d3634df8afa1a45822ed33733db90d79d2e87ad Mon Sep 17 00:00:00 2001 From: Evan Baker Date: Tue, 20 Aug 2024 13:53:10 -0500 Subject: [PATCH] backport: chore: move cns from servercore to nanoserver (#2454) (#2936) Signed-off-by: Evan Baker --- azure-ipam/windows.Dockerfile | 11 ++++++++++- cni/windows.Dockerfile | 11 ++++++++++- cns/windows.Dockerfile | 13 ++++++++----- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/azure-ipam/windows.Dockerfile b/azure-ipam/windows.Dockerfile index 7e3ffbb439..f4c7bbca36 100644 --- a/azure-ipam/windows.Dockerfile +++ b/azure-ipam/windows.Dockerfile @@ -27,6 +27,15 @@ WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_ COPY --from=compressor /payload/* pkg/embed/fs/ RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/dropgz -trimpath -ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" main.go -FROM mcr.microsoft.com/windows/nanoserver:${OS_VERSION} +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2019 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:7f6649348a11655e3576463fd6d55c29248f97405f8e643cab2409009339f520 AS ltsc2019 + +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2022 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:244113e50a678a25a63930780f9ccafd22e1a37aa9e3d93295e4cebf0f170a11 AS ltsc2022 + +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2025 --format "{{.Name}}@{{.Digest}}" ## 2025 isn't tagged yet +FROM mcr.microsoft.com/windows/nanoserver/insider@sha256:67e0ab7f3a79cd73be4a18bae24659c03b294aed0dbeaa624feb3810931f0bd2 AS ltsc2025 + +FROM ${OS_VERSION} AS windows COPY --from=dropgz /go/bin/dropgz dropgz ENTRYPOINT [ "/dropgz" ] diff --git a/cni/windows.Dockerfile b/cni/windows.Dockerfile index e363c74281..a7dd0a8054 100644 --- a/cni/windows.Dockerfile +++ b/cni/windows.Dockerfile @@ -35,6 +35,15 @@ WORKDIR /go/pkg/mod/github.com/azure/azure-container-networking/dropgz\@$DROPGZ_ COPY --from=compressor /payload/* pkg/embed/fs/ RUN GOOS=$OS CGO_ENABLED=0 go build -a -o /go/bin/dropgz -trimpath -ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" main.go -FROM mcr.microsoft.com/windows/nanoserver:${OS_VERSION} +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2019 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:7f6649348a11655e3576463fd6d55c29248f97405f8e643cab2409009339f520 AS ltsc2019 + +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2022 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:244113e50a678a25a63930780f9ccafd22e1a37aa9e3d93295e4cebf0f170a11 AS ltsc2022 + +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2025 --format "{{.Name}}@{{.Digest}}" ## 2025 isn't tagged yet +FROM mcr.microsoft.com/windows/nanoserver/insider@sha256:67e0ab7f3a79cd73be4a18bae24659c03b294aed0dbeaa624feb3810931f0bd2 AS ltsc2025 + +FROM ${OS_VERSION} AS windows COPY --from=dropgz /go/bin/dropgz dropgz ENTRYPOINT [ "/dropgz" ] diff --git a/cns/windows.Dockerfile b/cns/windows.Dockerfile index 4eb831b6aa..63fb85f2c7 100644 --- a/cns/windows.Dockerfile +++ b/cns/windows.Dockerfile @@ -7,13 +7,16 @@ WORKDIR /usr/local/src COPY . . RUN GOOS=windows CGO_ENABLED=0 go build -a -o /usr/local/bin/azure-cns.exe -ldflags "-X main.version="$VERSION" -X "$CNS_AI_PATH"="$CNS_AI_ID"" -gcflags="-dwarflocationlists=true" cns/service/*.go -# intermediate for win-ltsc2019 -FROM mcr.microsoft.com/windows/servercore@sha256:6fdf140282a2f809dae9b13fe441635867f0a27c33a438771673b8da8f3348a4 as ltsc2019 +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2019 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:7f6649348a11655e3576463fd6d55c29248f97405f8e643cab2409009339f520 AS ltsc2019 -# intermediate for win-ltsc2022 -FROM mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as ltsc2022 +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2022 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/windows/nanoserver@sha256:244113e50a678a25a63930780f9ccafd22e1a37aa9e3d93295e4cebf0f170a11 AS ltsc2022 -FROM ${OS_VERSION} +# skopeo inspect --override-os windows docker://mcr.microsoft.com/windows/nanoserver:ltsc2025 --format "{{.Name}}@{{.Digest}}" ## 2025 isn't tagged yet +FROM mcr.microsoft.com/windows/nanoserver/insider@sha256:67e0ab7f3a79cd73be4a18bae24659c03b294aed0dbeaa624feb3810931f0bd2 AS ltsc2025 + +FROM ${OS_VERSION} AS windows COPY --from=builder /usr/local/src/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml COPY --from=builder /usr/local/src/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /usr/local/bin/azure-cns.exe azure-cns.exe