diff --git a/.pipelines/cni/pipeline.yaml b/.pipelines/cni/pipeline.yaml index 20b0c16a08..e9a83f318b 100644 --- a/.pipelines/cni/pipeline.yaml +++ b/.pipelines/cni/pipeline.yaml @@ -39,46 +39,32 @@ stages: arch: amd64 name: azure-ipam os: linux - azure_ipam_windows2019_amd64: + azure_ipam_windows_amd64: arch: amd64 name: azure-ipam os: windows - os_version: ltsc2019 - azure_ipam_windows2022_amd64: - arch: amd64 - name: azure-ipam - os: windows - os_version: ltsc2022 cni_linux_amd64: arch: amd64 name: cni os: linux - cni_windows2019_amd64: - arch: amd64 - name: cni - os: windows - os_version: ltsc2019 - cni_windows2022_amd64: + cni_windows_amd64: arch: amd64 name: cni os: windows - os_version: ltsc2022 npm_linux_amd64: arch: amd64 name: npm os: linux - npm_windows2022_amd64: + npm_windows_amd64: arch: amd64 name: npm os: windows - os_version: ltsc2022 steps: - template: ../containers/container-template.yaml parameters: arch: $(arch) name: $(name) os: $(os) - os_version: $(os_version) - job: containerize_linux_arm64 displayName: Build Images pool: @@ -152,17 +138,14 @@ stages: platforms: linux/amd64 linux/arm64 windows/amd64 cni: name: cni - os_versions: ltsc2019 ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 npm: name: npm - os_versions: ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 steps: - template: ../containers/manifest-template.yaml parameters: name: $(name) - os_versions: $(os_versions) platforms: $(platforms) ## Windows E2E diff --git a/.pipelines/containers/container-template.yaml b/.pipelines/containers/container-template.yaml index fcbf88d7f2..aaf54b8e8e 100644 --- a/.pipelines/containers/container-template.yaml +++ b/.pipelines/containers/container-template.yaml @@ -2,7 +2,6 @@ parameters: arch: "" name: "" os: "" - os_version: "" steps: - task: AzureCLI@2 @@ -17,7 +16,7 @@ steps: - script: | set -e if [ ${{ parameters.os }} = 'windows' ]; then export BUILDX_ACTION='--push'; fi - make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }} OS_VERSION=${{ parameters.os_version }} + make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }} name: image_build displayName: Image Build retryCountOnTaskFailure: 3 diff --git a/.pipelines/containers/manifest-template.yaml b/.pipelines/containers/manifest-template.yaml index bb41ea5bb1..a5f3f7551e 100644 --- a/.pipelines/containers/manifest-template.yaml +++ b/.pipelines/containers/manifest-template.yaml @@ -1,7 +1,6 @@ parameters: name: "" platforms: "" - os_versions: "" steps: @@ -16,7 +15,7 @@ steps: - script: | set -e - make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" OS_VERSIONS="${{ parameters.os_versions }}" + make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" name: manifest_build displayName: Manifest Build retryCountOnTaskFailure: 3 diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 47014fc8b3..7b730e8727 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -110,44 +110,26 @@ stages: arch: amd64 name: azure-ipam os: linux - azure_ipam_windows2019_amd64: + azure_ipam_windows_amd64: arch: amd64 name: azure-ipam os: windows - os_version: ltsc2019 - azure_ipam_windows2022_amd64: - arch: amd64 - name: azure-ipam - os: windows - os_version: ltsc2022 cni_linux_amd64: arch: amd64 name: cni os: linux - cni_windows2019_amd64: + cni_windows_amd64: arch: amd64 name: cni os: windows - os_version: ltsc2019 - cni_windows2022_amd64: - arch: amd64 - name: cni - os: windows - os_version: ltsc2022 cns_linux_amd64: arch: amd64 name: cns os: linux - cns_windows2019_amd64: - arch: amd64 - name: cns - os: windows - os_version: ltsc2019 - cns_windows2022_amd64: + cns_windows_amd64: arch: amd64 name: cns os: windows - os_version: ltsc2022 ipv6_hp_bpf_linux_amd64: arch: amd64 name: ipv6-hp-bpf @@ -156,18 +138,16 @@ stages: arch: amd64 name: npm os: linux - npm_windows2022_amd64: + npm_windows_amd64: arch: amd64 name: npm os: windows - os_version: ltsc2022 steps: - template: containers/container-template.yaml parameters: arch: $(arch) name: $(name) os: $(os) - os_version: $(os_version) - job: containerize_linux_arm64 displayName: Build Images pool: @@ -216,28 +196,23 @@ stages: matrix: azure_ipam: name: azure-ipam - os_versions: ltsc2019 ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 cni: name: cni - os_versions: ltsc2019 ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 cns: name: cns - os_versions: ltsc2019 ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 ipv6_hp_bpf: name: ipv6-hp-bpf platforms: linux/amd64 linux/arm64 npm: name: npm - os_versions: ltsc2022 platforms: linux/amd64 linux/arm64 windows/amd64 steps: - template: containers/manifest-template.yaml parameters: name: $(name) - os_versions: $(os_versions) platforms: $(platforms) # Cilium Podsubnet E2E tests diff --git a/Makefile b/Makefile index 1eb8a0eee0..7e21d18ec8 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,6 @@ GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) GOOSES ?= "linux windows" # To override at the cli do: GOOSES="\"darwin bsd\"" GOARCHES ?= "amd64 arm64" # To override at the cli do: GOARCHES="\"ppc64 mips\"" -ltsc2019 = "10.0.17763.4010" -ltsc2022 = "10.0.20348.643" # Windows specific extensions # set these based on the GOOS, not the OS @@ -274,15 +272,15 @@ CNS_IMAGE = azure-cns NPM_IMAGE = azure-npm ## Image platform tags. -ACNCLI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(ACN_VERSION) -AZURE_IPAM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(AZURE_IPAM_VERSION) -AZURE_IPAM_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(AZURE_IPAM_VERSION)-$(OS_SKU_WIN) -IPV6_HP_BPF_IMAGE_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(IPV6_HP_BPF_VERSION) -CNI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_VERSION) -CNI_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_VERSION)-$(OS_SKU_WIN) -CNS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNS_VERSION) -CNS_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNS_VERSION)-$(OS_SKU_WIN) -NPM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(NPM_VERSION) +ACNCLI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(ACN_VERSION) +AZURE_IPAM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(AZURE_IPAM_VERSION) +AZURE_IPAM_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(AZURE_IPAM_VERSION) +IPV6_HP_BPF_IMAGE_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(IPV6_HP_BPF_VERSION) +CNI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNI_VERSION) +CNI_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNI_VERSION) +CNS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNS_VERSION) +CNS_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNS_VERSION) +NPM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(NPM_VERSION) qemu-user-static: ## Set up the host to run qemu multiplatform container builds. @@ -316,8 +314,7 @@ container: # util target to build container images. do not invoke directly. PLATFORM=$(PLATFORM) \ TAG=$(TAG) \ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) container-push: # util target to publish container image. do not invoke directly. $(CONTAINER_BUILDER) push \ @@ -367,12 +364,11 @@ azure-ipam-image: ## build azure-ipam container image. $(MAKE) container \ DOCKERFILE=azure-ipam/$(OS).Dockerfile \ IMAGE=$(AZURE_IPAM_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION)' \ + EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH)' \ PLATFORM=$(PLATFORM) \ TAG=$(AZURE_IPAM_PLATFORM_TAG) \ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) azure-ipam-image-push: ## push azure-ipam container image. $(MAKE) container-push \ @@ -396,12 +392,11 @@ ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image. $(MAKE) container \ DOCKERFILE=bpf-prog/ipv6-hp-bpf/$(OS).Dockerfile \ IMAGE=$(IPV6_HP_BPF_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION) --build-arg DEBUG=$(DEBUG)'\ + EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)'\ PLATFORM=$(PLATFORM) \ TAG=$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) \ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) ipv6-hp-bpf-image-push: ## push ipv6-hp-bpf container image. $(MAKE) container-push \ @@ -425,12 +420,11 @@ cni-image: ## build cni container image. $(MAKE) container \ DOCKERFILE=cni/$(OS).Dockerfile \ IMAGE=$(CNI_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION) --build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' \ + EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' \ PLATFORM=$(PLATFORM) \ TAG=$(CNI_PLATFORM_TAG) \ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) cni-image-push: ## push cni container image. $(MAKE) container-push \ @@ -455,12 +449,11 @@ cns-image: ## build cns container image. $(MAKE) container \ DOCKERFILE=cns/$(OS).Dockerfile \ IMAGE=$(CNS_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID) --build-arg OS_VERSION=$(OS_VERSION)' \ + EXTRA_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' \ PLATFORM=$(PLATFORM) \ TAG=$(CNS_PLATFORM_TAG) \ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) cns-image-push: ## push cns container image. $(MAKE) container-push \ @@ -484,12 +477,11 @@ npm-image: ## build the npm container image. $(MAKE) container-$(CONTAINER_BUILDER) \ DOCKERFILE=npm/$(OS).Dockerfile \ IMAGE=$(NPM_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID) --build-arg OS_VERSION=$(OS_VERSION)' \ + EXTRA_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' \ PLATFORM=$(PLATFORM) \ TAG=$(NPM_PLATFORM_TAG)\ OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) + ARCH=$(ARCH) npm-image-push: ## push npm container image. $(MAKE) container-push \ @@ -543,21 +535,18 @@ manifest-create: $(CONTAINER_BUILDER) manifest create $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) manifest-add: - $(CONTAINER_BUILDER) manifest add --os=$(OS) --os-version=$($(OS_VERSION)) $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(TAG) + $(CONTAINER_BUILDER) manifest add --os=$(OS) $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(subst /,-,$(PLATFORM))-$(TAG) manifest-build: # util target to compose multiarch container manifests from platform specific images. $(MAKE) manifest-create $(foreach PLATFORM,$(PLATFORMS),\ $(if $(filter $(PLATFORM),windows/amd64),\ - $(foreach OS_VERSION,$(OS_VERSIONS),\ - $(MAKE) manifest-add CONTAINER_BUILDER=$(CONTAINER_BUILDER) OS=windows OS_VERSION=$(OS_VERSION) PLATFORM=$(PLATFORM);\ - ),\ - $(MAKE) manifest-add PLATFORM=$(PLATFORM);\ + $(MAKE) manifest-add CONTAINER_BUILDER=$(CONTAINER_BUILDER) OS=windows PLATFORM=$(PLATFORM);,\ + $(MAKE) manifest-add PLATFORM=$(PLATFORM);\ )\ )\ - manifest-push: # util target to push multiarch container manifest. $(CONTAINER_BUILDER) manifest push --all $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(TAG) @@ -586,8 +575,7 @@ azure-ipam-manifest-build: ## build azure-ipam multiplat container manifest. $(MAKE) manifest-build \ PLATFORMS="$(PLATFORMS)" \ IMAGE=$(AZURE_IPAM_IMAGE) \ - TAG=$(AZURE_IPAM_VERSION) \ - OS_VERSIONS="$(OS_VERSIONS)" + TAG=$(AZURE_IPAM_VERSION) azure-ipam-manifest-push: ## push azure-ipam multiplat container manifest $(MAKE) manifest-push \ @@ -603,8 +591,7 @@ ipv6-hp-bpf-manifest-build: ## build ipv6-hp-bpf multiplat container manifest. $(MAKE) manifest-build \ PLATFORMS="$(PLATFORMS)" \ IMAGE=$(IPV6_HP_BPF_IMAGE) \ - TAG=$(IPV6_HP_BPF_VERSION) \ - OS_VERSIONS="$(OS_VERSIONS)" + TAG=$(IPV6_HP_BPF_VERSION) ipv6-hp-bpf-manifest-push: ## push ipv6-hp-bpf multiplat container manifest $(MAKE) manifest-push \ @@ -620,8 +607,7 @@ cni-manifest-build: ## build cni multiplat container manifest. $(MAKE) manifest-build \ PLATFORMS="$(PLATFORMS)" \ IMAGE=$(CNI_IMAGE) \ - TAG=$(CNI_VERSION) \ - OS_VERSIONS="$(OS_VERSIONS)" + TAG=$(CNI_VERSION) cni-manifest-push: ## push cni multiplat container manifest $(MAKE) manifest-push \ @@ -637,8 +623,7 @@ cns-manifest-build: ## build azure-cns multiplat container manifest. $(MAKE) manifest-build \ PLATFORMS="$(PLATFORMS)" \ IMAGE=$(CNS_IMAGE) \ - TAG=$(CNS_VERSION) \ - OS_VERSIONS="$(OS_VERSIONS)" + TAG=$(CNS_VERSION) cns-manifest-push: ## push cns multiplat container manifest $(MAKE) manifest-push \ @@ -654,8 +639,7 @@ npm-manifest-build: ## build azure-npm multiplat container manifest. $(MAKE) manifest-build \ PLATFORMS="$(PLATFORMS)" \ IMAGE=$(NPM_IMAGE) \ - TAG=$(NPM_VERSION) \ - OS_VERSIONS="$(OS_VERSIONS)" + TAG=$(NPM_VERSION) npm-manifest-push: ## push multiplat container manifest $(MAKE) manifest-push \ diff --git a/azure-ipam/linux.Dockerfile b/azure-ipam/linux.Dockerfile index 2b3361ed28..4f15ea7ae7 100644 --- a/azure-ipam/linux.Dockerfile +++ b/azure-ipam/linux.Dockerfile @@ -1,6 +1,5 @@ ARG ARCH ARG DROPGZ_VERSION=v0.0.12 -ARG OS_VERSION ARG OS FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS azure-ipam diff --git a/azure-ipam/windows.Dockerfile b/azure-ipam/windows.Dockerfile index 2d57efbcd8..1d3266271d 100644 --- a/azure-ipam/windows.Dockerfile +++ b/azure-ipam/windows.Dockerfile @@ -1,7 +1,6 @@ ARG ARCH ARG DROPGZ_VERSION=v0.0.12 ARG OS -ARG OS_VERSION FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS azure-ipam ARG OS @@ -27,15 +26,7 @@ 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 -# 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 +# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows COPY --from=dropgz /go/bin/dropgz dropgz ENTRYPOINT [ "/dropgz" ] diff --git a/cni/linux.Dockerfile b/cni/linux.Dockerfile index 828486d977..38092126d9 100644 --- a/cni/linux.Dockerfile +++ b/cni/linux.Dockerfile @@ -1,6 +1,5 @@ ARG ARCH ARG DROPGZ_VERSION=v0.0.12 -ARG OS_VERSION ARG OS FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS azure-vnet diff --git a/cni/windows.Dockerfile b/cni/windows.Dockerfile index b0d86e0e12..85ed310574 100644 --- a/cni/windows.Dockerfile +++ b/cni/windows.Dockerfile @@ -1,7 +1,6 @@ ARG ARCH ARG DROPGZ_VERSION=v0.0.12 ARG OS -ARG OS_VERSION FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS azure-vnet ARG OS @@ -37,15 +36,7 @@ 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 -# 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 +# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows COPY --from=dropgz /go/bin/dropgz dropgz ENTRYPOINT [ "/dropgz" ] diff --git a/cns/windows.Dockerfile b/cns/windows.Dockerfile index 18974b3d2e..3003d72b1c 100644 --- a/cns/windows.Dockerfile +++ b/cns/windows.Dockerfile @@ -1,4 +1,3 @@ -ARG OS_VERSION FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS builder ARG VERSION ARG CNS_AI_PATH @@ -7,16 +6,8 @@ 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 -# 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 +# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" +FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b 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 diff --git a/dropgz/build/linux.Dockerfile b/dropgz/build/linux.Dockerfile deleted file mode 100644 index 8d819cb28c..0000000000 --- a/dropgz/build/linux.Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS tar -RUN tdnf install -y tar -RUN tdnf upgrade -y && tdnf install -y ca-certificates - -FROM tar AS azure-ipam -ARG AZIPAM_VERSION=v0.0.6 -ARG VERSION -ARG OS -ARG ARCH -WORKDIR /azure-ipam -COPY ./azure-ipam . -RUN curl -LO --cacert /etc/ssl/certs/ca-certificates.crt https://github.com/Azure/azure-container-networking/releases/download/azure-ipam%2F$AZIPAM_VERSION/azure-ipam-$OS-$ARCH-$AZIPAM_VERSION.tgz && tar -xvf azure-ipam-$OS-$ARCH-$AZIPAM_VERSION.tgz - -FROM tar AS azure-vnet -ARG AZCNI_VERSION=v1.5.30 -ARG VERSION -ARG OS -ARG ARCH -WORKDIR /azure-container-networking -COPY . . -RUN curl -LO --cacert /etc/ssl/certs/ca-certificates.crt https://github.com/Azure/azure-container-networking/releases/download/$AZCNI_VERSION/azure-vnet-cni-swift-$OS-$ARCH-$AZCNI_VERSION.tgz && tar -xvf azure-vnet-cni-swift-$OS-$ARCH-$AZCNI_VERSION.tgz - -FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor -ARG OS -WORKDIR /dropgz -COPY dropgz . -COPY --from=azure-ipam /azure-ipam/*.conflist pkg/embed/fs -COPY --from=azure-ipam /azure-ipam/azure-ipam pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS.conflist pkg/embed/fs/azure.conflist -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift.conflist pkg/embed/fs/azure-swift.conflist -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay.conflist pkg/embed/fs/azure-swift-overlay.conflist -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay-dualstack.conflist pkg/embed/fs/azure-swift-overlay-dualstack.conflist -COPY --from=azure-vnet /azure-container-networking/azure-vnet pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/azure-vnet-ipam pkg/embed/fs -RUN cd pkg/embed/fs/ && sha256sum * > sum.txt -RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done - -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS dropgz -ARG VERSION -WORKDIR /dropgz -COPY --from=compressor /dropgz . -RUN CGO_ENABLED=0 go build -a -o bin/dropgz -trimpath -ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$VERSION"" -gcflags="-dwarflocationlists=true" main.go - -FROM scratch -COPY --from=dropgz /dropgz/bin/dropgz /dropgz -ENTRYPOINT [ "/dropgz" ] diff --git a/dropgz/build/windows.Dockerfile b/dropgz/build/windows.Dockerfile deleted file mode 100644 index 06564b6f0c..0000000000 --- a/dropgz/build/windows.Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -ARG ARCH -ARG OS_VERSION -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core:2.0 AS tar -RUN tdnf install -y tar -RUN tdnf install -y unzip -RUN tdnf upgrade -y && tdnf install -y ca-certificates - -FROM tar AS azure-vnet -ARG AZCNI_VERSION=v1.5.30 -ARG VERSION -ARG OS -ARG ARCH -WORKDIR /azure-container-networking -COPY . . -RUN curl -LO --cacert /etc/ssl/certs/ca-certificates.crt https://github.com/Azure/azure-container-networking/releases/download/$AZCNI_VERSION/azure-vnet-cni-$OS-$ARCH-$AZCNI_VERSION.zip && unzip -o azure-vnet-cni-$OS-$ARCH-$AZCNI_VERSION.zip - -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core:2.0 AS compressor -ARG OS -WORKDIR /dropgz -COPY dropgz . -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay.conflist pkg/embed/fs/azure-swift-overlay.conflist -COPY --from=azure-vnet /azure-container-networking/cni/azure-$OS-swift-overlay-dualstack.conflist pkg/embed/fs/azure-swift-overlay-dualstack.conflist -COPY --from=azure-vnet /azure-container-networking/azure-vnet.exe pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry.exe pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/azure-vnet-ipam.exe pkg/embed/fs -COPY --from=azure-vnet /azure-container-networking/azure-vnet-telemetry.config pkg/embed/fs -RUN cd pkg/embed/fs/ && sha256sum * > sum.txt -RUN gzip --verbose --best --recursive pkg/embed/fs && for f in pkg/embed/fs/*.gz; do mv -- "$f" "${f%%.gz}"; done - -FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS dropgz -ARG VERSION -WORKDIR /dropgz -COPY --from=compressor /dropgz . -RUN GOOS=windows CGO_ENABLED=0 go build -a -o bin/dropgz.exe -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} -COPY --from=dropgz /dropgz/bin/dropgz.exe dropgz.exe -ENTRYPOINT [ "dropgz.exe" ] diff --git a/npm/windows.Dockerfile b/npm/windows.Dockerfile index 2e480c02c2..71eba76b19 100644 --- a/npm/windows.Dockerfile +++ b/npm/windows.Dockerfile @@ -1,4 +1,3 @@ -ARG OS_VERSION FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS builder ARG VERSION ARG NPM_AI_PATH @@ -8,9 +7,7 @@ COPY . . RUN GOOS=windows CGO_ENABLED=0 go build -v -o /usr/local/bin/azure-npm.exe -ldflags "-X main.version="$VERSION" -X "$NPM_AI_PATH"="$NPM_AI_ID"" -gcflags="-dwarflocationlists=true" npm/cmd/*.go # intermediate for win-ltsc2022 -FROM mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as ltsc2022 - -FROM ${OS_VERSION} +FROM mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as windows COPY --from=builder /usr/local/src/npm/examples/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml COPY --from=builder /usr/local/src/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /usr/local/src/npm/examples/windows/setkubeconfigpath-capz.ps1 setkubeconfigpath-capz.ps1