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/build/images.mk b/build/images.mk index d1da4e03cd..8ed3333867 100644 --- a/build/images.mk +++ b/build/images.mk @@ -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}