diff --git a/.pipelines/build/dockerfiles/cni.Dockerfile b/.pipelines/build/dockerfiles/cni.Dockerfile index dd4d32a4f2..c4d38741b8 100644 --- a/.pipelines/build/dockerfiles/cni.Dockerfile +++ b/.pipelines/build/dockerfiles/cni.Dockerfile @@ -1,8 +1,9 @@ +# !! AUTOGENERATED - DO NOT EDIT !! +# SOURCE: .pipelines/build/dockerfiles/cni.Dockerfile.tmpl ARG ARCH - -# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" -FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows +# mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 +FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b AS windows ARG ARTIFACT_DIR . COPY ${ARTIFACT_DIR}/bin/dropgz.exe /dropgz.exe diff --git a/.pipelines/build/dockerfiles/cni.Dockerfile.tmpl b/.pipelines/build/dockerfiles/cni.Dockerfile.tmpl new file mode 100644 index 0000000000..004ddb191c --- /dev/null +++ b/.pipelines/build/dockerfiles/cni.Dockerfile.tmpl @@ -0,0 +1,17 @@ +# {{.RENDER_MSG}} +# SOURCE: {{.SRC_PIPE}} +ARG ARCH + +# {{.WIN_HPC_IMG}} +FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} AS windows +ARG ARTIFACT_DIR . + +COPY ${ARTIFACT_DIR}/bin/dropgz.exe /dropgz.exe +ENTRYPOINT [ "/dropgz.exe" ] + + +FROM scratch AS linux +ARG ARTIFACT_DIR . + +COPY ${ARTIFACT_DIR}/bin/dropgz /dropgz +ENTRYPOINT [ "/dropgz" ] diff --git a/.pipelines/build/dockerfiles/cns.Dockerfile b/.pipelines/build/dockerfiles/cns.Dockerfile index 97e3f36477..f1fed9705d 100644 --- a/.pipelines/build/dockerfiles/cns.Dockerfile +++ b/.pipelines/build/dockerfiles/cns.Dockerfile @@ -1,6 +1,7 @@ +# !! AUTOGENERATED - DO NOT EDIT !! +# SOURCE: .pipelines/build/dockerfiles/cns.Dockerfile.tmpl ARG ARCH - # mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b AS windows ARG ARTIFACT_DIR . @@ -11,14 +12,12 @@ COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe ENTRYPOINT ["azure-cns.exe"] EXPOSE 10090 - -# mcr.microsoft.com/cbl-mariner/base/core:2.0 -# skopeo inspect docker://mcr.microsoft.com/cbl-mariner/base/core:2.0 --format "{{.Name}}@{{.Digest}}" -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core@sha256:961bfedbbbdc0da51bc664f51d959da292eced1ad46c3bf674aba43b9be8c703 AS build-helper +# mcr.microsoft.com/azurelinux/base/core:3.0 +FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:9948138108a3d69f1dae62104599ac03132225c3b7a5ac57b85a214629c8567d AS build-helper RUN tdnf install -y iptables -# mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:7778a86d86947d5f64c1280a7ee0cf36c6c6d76b5749dd782fbcc14f113961bf AS linux +# mcr.microsoft.com/azurelinux/distroless/minimal:3.0 +FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/distroless/minimal@sha256:0801b80a0927309572b9adc99bd1813bc680473175f6e8175cd4124d95dbd50c AS linux ARG ARTIFACT_DIR . COPY --from=build-helper /usr/sbin/*tables* /usr/sbin/ diff --git a/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl b/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl new file mode 100644 index 0000000000..492be61bac --- /dev/null +++ b/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl @@ -0,0 +1,27 @@ +# {{.RENDER_MSG}} +# SOURCE: {{.SRC_PIPE}} +ARG ARCH + +# {{.WIN_HPC_IMG}} +FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} AS windows +ARG ARTIFACT_DIR . + +COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml +COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1 +COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe +ENTRYPOINT ["azure-cns.exe"] +EXPOSE 10090 + +# {{.MARINER_CORE_IMG}} +FROM --platform=linux/${ARCH} {{.MARINER_CORE_PIN}} AS build-helper +RUN tdnf install -y iptables + +# {{.MARINER_DISTROLESS_IMG}} +FROM --platform=linux/${ARCH} {{.MARINER_DISTROLESS_PIN}} AS linux +ARG ARTIFACT_DIR . + +COPY --from=build-helper /usr/sbin/*tables* /usr/sbin/ +COPY --from=build-helper /usr/lib /usr/lib +COPY ${ARTIFACT_DIR}/bin/azure-cns /usr/local/bin/azure-cns +ENTRYPOINT [ "/usr/local/bin/azure-cns" ] +EXPOSE 10090 diff --git a/azure-ipam/Dockerfile b/azure-ipam/Dockerfile index 1cd4dd3e98..50a91413fb 100644 --- a/azure-ipam/Dockerfile +++ b/azure-ipam/Dockerfile @@ -3,11 +3,11 @@ ARG DROPGZ_VERSION=v0.0.12 ARG OS_VERSION ARG OS -# skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.23.2-cbl-mariner2.0 --format "{{.Name}}@{{.Digest}}" -FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:f8613198423d5cb702961f1547f9cb061f8da1c6ca9ce8da4824eb47db663cd7 AS go +# skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.23.2-azurelinux3.0 --format "{{.Name}}@{{.Digest}}" +FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:f1f0cbd464ae4cd9d41176d47f1f9fe16a6965425871f817587314e3a04576ec AS go -# skopeo inspect docker://mcr.microsoft.com/cbl-mariner/base/core:2.0 --format "{{.Name}}@{{.Digest}}" -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core@sha256:a490e0b0869dc570ae29782c2bc17643aaaad1be102aca83ce0b96e0d0d2d328 AS mariner-core +# skopeo inspect docker://mcr.microsoft.com/azurelinux/base/core:3.0 --format "{{.Name}}@{{.Digest}}" +FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:b46476be0b5c9691ad20f78871819950c01433bdfad81d72c61618f4a6202b25 AS mariner-core FROM go AS azure-ipam ARG OS diff --git a/build/images.mk b/build/images.mk index d1da4e03cd..76fa71682e 100644 --- a/build/images.mk +++ b/build/images.mk @@ -1,7 +1,7 @@ # Source images -export GO_IMG ?= mcr.microsoft.com/oss/go/microsoft/golang:1.23-cbl-mariner2.0 -export MARINER_CORE_IMG ?= mcr.microsoft.com/cbl-mariner/base/core:2.0 -export MARINER_DISTROLESS_IMG ?= mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 +export GO_IMG ?= mcr.microsoft.com/oss/go/microsoft/golang:1.23-azurelinux3.0 +export MARINER_CORE_IMG ?= mcr.microsoft.com/azurelinux/base/core:3.0 +export MARINER_DISTROLESS_IMG ?= mcr.microsoft.com/azurelinux/distroless/minimal:3.0 export WIN_HPC_IMG ?= mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 @@ -15,6 +15,10 @@ export RENDER_MSG ?= "!! AUTOGENERATED - DO NOT EDIT !!" export SRC ?= ${PATH}/Dockerfile.tmpl export DEST ?= ${PATH}/Dockerfile +export PIPE_PATH ?= .pipelines/build/dockerfiles +export SRC_PIPE ?= ${PIPE_PATH}/${PATH}.Dockerfile.tmpl +export DEST_PIPE ?= ${PIPE_PATH}/${PATH}.Dockerfile + print: @echo ${GO_PIN} @echo ${MARINER_CORE_PIN} @@ -23,3 +27,4 @@ print: render: build/tools/bin/renderkit -f ${SRC} --ds env:// > ${DEST} + build/tools/bin/renderkit -f ${SRC_PIPE} --ds env:// > ${DEST_PIPE} diff --git a/cni/Dockerfile b/cni/Dockerfile index 61f9f52e69..6f0eb2e5e5 100644 --- a/cni/Dockerfile +++ b/cni/Dockerfile @@ -5,11 +5,11 @@ ARG DROPGZ_VERSION=v0.0.12 ARG OS_VERSION ARG OS -# mcr.microsoft.com/oss/go/microsoft/golang:1.23-cbl-mariner2.0 -FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:f1cb092e89f5f3448b6db87729039c61541cb85747c690f760b3017218d449bb AS go +# mcr.microsoft.com/oss/go/microsoft/golang:1.23-azurelinux3.0 +FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:8f60e85f4b2f567c888d0b3a4cd12dc74bee534d94c528655546452912d90c74 AS go -# mcr.microsoft.com/cbl-mariner/base/core:2.0 -FROM --platform=linux/${ARCH} mcr.microsoft.com/cbl-mariner/base/core@sha256:12480ee9f027c304fabc17d70afc7d5da6c49ad46f0401947478e7218ea0ff6c AS mariner-core +# mcr.microsoft.com/azurelinux/base/core:3.0 +FROM --platform=linux/${ARCH} mcr.microsoft.com/azurelinux/base/core@sha256:9948138108a3d69f1dae62104599ac03132225c3b7a5ac57b85a214629c8567d AS mariner-core FROM go AS azure-vnet ARG OS diff --git a/cns/Dockerfile b/cns/Dockerfile index dbd9078810..1c76e949b1 100644 --- a/cns/Dockerfile +++ b/cns/Dockerfile @@ -4,14 +4,14 @@ ARG ARCH ARG OS_VERSION ARG OS -# mcr.microsoft.com/oss/go/microsoft/golang:1.23-cbl-mariner2.0 -FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:f1cb092e89f5f3448b6db87729039c61541cb85747c690f760b3017218d449bb AS go +# mcr.microsoft.com/oss/go/microsoft/golang:1.23-azurelinux3.0 +FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:8f60e85f4b2f567c888d0b3a4cd12dc74bee534d94c528655546452912d90c74 AS go -# mcr.microsoft.com/cbl-mariner/base/core:2.0 -FROM mcr.microsoft.com/cbl-mariner/base/core@sha256:12480ee9f027c304fabc17d70afc7d5da6c49ad46f0401947478e7218ea0ff6c AS mariner-core +# mcr.microsoft.com/azurelinux/base/core:3.0 +FROM mcr.microsoft.com/azurelinux/base/core@sha256:9948138108a3d69f1dae62104599ac03132225c3b7a5ac57b85a214629c8567d AS mariner-core -# mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 -FROM mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:a2529d152e75b29502a8de264a4f3dfb8fd126d870c9bf4456d03b7a7dab7268 AS mariner-distroless +# mcr.microsoft.com/azurelinux/distroless/minimal:3.0 +FROM mcr.microsoft.com/azurelinux/distroless/minimal@sha256:0801b80a0927309572b9adc99bd1813bc680473175f6e8175cd4124d95dbd50c AS mariner-distroless FROM --platform=linux/${ARCH} go AS builder ARG OS diff --git a/npm/linux.Dockerfile b/npm/linux.Dockerfile index 3c278d2467..1e87a6a538 100644 --- a/npm/linux.Dockerfile +++ b/npm/linux.Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS builder +FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23-azurelinux3.0 AS builder ARG VERSION ARG NPM_AI_PATH ARG NPM_AI_ID diff --git a/npm/windows.Dockerfile b/npm/windows.Dockerfile index 9edae66a12..ffee28af12 100644 --- a/npm/windows.Dockerfile +++ b/npm/windows.Dockerfile @@ -1,5 +1,5 @@ ARG OS_VERSION -FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS builder +FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.23-azurelinux3.0 AS builder ARG VERSION ARG NPM_AI_PATH ARG NPM_AI_ID