File tree Expand file tree Collapse file tree 5 files changed +27
-19
lines changed Expand file tree Collapse file tree 5 files changed +27
-19
lines changed Original file line number Diff line number Diff line change 11ARG ARCH
2- ARG ARCHIVE_DIR
2+ ARG ARTIFACT_DIR
33
44# mcr.microsoft.com/cbl-mariner/base/core:2.0
55FROM mcr.microsoft.com/cbl-mariner/base/core@sha256:961bfedbbbdc0da51bc664f51d959da292eced1ad46c3bf674aba43b9be8c703 AS iptables
@@ -9,15 +9,15 @@ RUN tdnf install -y iptables
99FROM mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:7778a86d86947d5f64c1280a7ee0cf36c6c6d76b5749dd782fbcc14f113961bf AS linux
1010COPY --from=iptables /usr/sbin/*tables* /usr/sbin/
1111COPY --from=iptables /usr/lib /usr/lib
12- COPY ${ARCHIVE_DIR }/bins/azure-cns /usr/local/bin/azure-cns
12+ COPY ${ARTIFACT_DIR }/bins/azure-cns /usr/local/bin/azure-cns
1313ENTRYPOINT [ "/usr/local/bin/azure-cns" ]
1414EXPOSE 10090
1515
1616
1717# mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
1818FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b AS windows
19- COPY ${ARCHIVE_DIR }/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
20- COPY ${ARCHIVE_DIR }/files/setkubeconfigpath.ps1 setkubeconfigpath.ps1
21- COPY ${ARCHIVE_DIR }/bins/azure-cns /azure-cns.exe
19+ COPY ${ARTIFACT_DIR }/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
20+ COPY ${ARTIFACT_DIR }/files/setkubeconfigpath.ps1 setkubeconfigpath.ps1
21+ COPY ${ARTIFACT_DIR }/bins/azure-cns /azure-cns.exe
2222ENTRYPOINT ["azure-cns.exe" ]
2323EXPOSE 10090
Original file line number Diff line number Diff line change 1- ARG ARCHIVE_DIR
1+ ARG ARTIFACT_DIR
22
33FROM mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 AS linux
4- COPY ${ARCHIVE_DIR }/lib/* /lib
5- COPY ${ARCHIVE_DIR }/bins/ipv6-hp-bpf /ipv6-hp-bpf
6- COPY ${ARCHIVE_DIR }/bins/nft /usr/sbin/nft
7- COPY ${ARCHIVE_DIR }/bins/ip /sbin/ip
4+ COPY ${ARTIFACT_DIR }/lib/* /lib
5+ COPY ${ARTIFACT_DIR }/bins/ipv6-hp-bpf /ipv6-hp-bpf
6+ COPY ${ARTIFACT_DIR }/bins/nft /usr/sbin/nft
7+ COPY ${ARTIFACT_DIR }/bins/ip /sbin/ip
88CMD ["/ipv6-hp-bpf" ]
Original file line number Diff line number Diff line change @@ -115,6 +115,6 @@ jobs:
115115 name : $(name)
116116 dockerfile_path : ${{ job_data.templateContext.pkgArtifact }}
117117 build_tag : $(imageTag)
118- extra_args : $(extraArgs)
118+ extra_args : $(extraArgs) --build-arg ARTIFACT_DIR="${{ job_data.templateContext.pkgArtifact }}"
119119 archive_file : $(archiveName)-$(OS)-$(ARCH)-$(archiveVersion)
120120 source : ${{ job_data.templateContext.pkgArtifact }}
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ export GOOS=$OS
1010export GOARCH=$ARCH
1111export CGO_ENABLED=0
1212
13- CNI_BUILD_DIR=" $BUILD_DIR " /cni
13+ CNI_BUILD_DIR=" $REPO_ROOT " /cni
1414STATELESS_CNI_BUILD_DIR=" $CNI_BUILD_DIR " /stateless
15- CNI_MULTITENANCY_BUILD_DIR=" $BUILD_DIR " /cni-multitenancy
16- CNI_MULTITENANCY_TRANSPARENT_VLAN_BUILD_DIR=" $BUILD_DIR " /cni-multitenancy-transparent-vlan
17- CNI_SWIFT_BUILD_DIR=" $BUILD_DIR " /cni-swift
18- CNI_OVERLAY_BUILD_DIR=" $BUILD_DIR " /cni-overlay
19- CNI_BAREMETAL_BUILD_DIR=" $BUILD_DIR " /cni-baremetal
20- CNI_DUALSTACK_BUILD_DIR=" $BUILD_DIR " /cni-dualstack
15+ CNI_MULTITENANCY_BUILD_DIR=" $REPO_ROOT " /cni-multitenancy
16+ CNI_MULTITENANCY_TRANSPARENT_VLAN_BUILD_DIR=" $REPO_ROOT " /cni-multitenancy-transparent-vlan
17+ CNI_SWIFT_BUILD_DIR=" $REPO_ROOT " /cni-swift
18+ CNI_OVERLAY_BUILD_DIR=" $REPO_ROOT " /cni-overlay
19+ CNI_BAREMETAL_BUILD_DIR=" $REPO_ROOT " /cni-baremetal
20+ CNI_DUALSTACK_BUILD_DIR=" $REPO_ROOT " /cni-dualstack
2121
2222CNI_TEMP_DIR=$( mktemp -d -p " $GEN_DIR " )
2323
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -nex
33
4+ export GOOS=$OS
5+ export GOARCH=$ARCH
6+ export CGO_ENABLED=0
7+
48mkdir -p " $OUT_DIR " /files
59mkdir -p " $OUT_DIR " /bins
610
711pushd " $REPO_ROOT " /cns
8- GOOS=$OS CGO_ENABLED=0 go build -a -o " $OUT_DIR " /bins/azure-cns -ldflags " -X main.version=" $VERSION " -X " $CNS_AI_PATH " =" $CNS_AI_ID " " -gcflags=" -dwarflocationlists=true" service/* .go
12+ go build -v -a \
13+ -o " $OUT_DIR " /bins/azure-cns \
14+ -ldflags " -X main.version=" $CNS_VERSION " -X " $CNS_AI_PATH " =" $CNS_AI_ID " " \
15+ -gcflags=" -dwarflocationlists=true" \
16+ service/* .go
917 cp kubeconfigtemplate.yaml " $OUT_DIR " /files/kubeconfigtemplate.yaml
1018 cp ../npm/examples/windows/setkubeconfigpath.ps1 " $OUT_DIR " /files/setkubeconfigpath.ps1
1119 cp configuration/cns_config.json " $OUT_DIR " /files/cns_config.json
You can’t perform that action at this time.
0 commit comments