Skip to content

Commit 0f643eb

Browse files
committed
fixup! Use Signed Binaries for Docker Build
1 parent cd24315 commit 0f643eb

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG ARCH
2-
ARG ARCHIVE_DIR
2+
ARG ARTIFACT_DIR
33

44
# mcr.microsoft.com/cbl-mariner/base/core:2.0
55
FROM mcr.microsoft.com/cbl-mariner/base/core@sha256:961bfedbbbdc0da51bc664f51d959da292eced1ad46c3bf674aba43b9be8c703 AS iptables
@@ -9,15 +9,15 @@ RUN tdnf install -y iptables
99
FROM mcr.microsoft.com/cbl-mariner/distroless/minimal@sha256:7778a86d86947d5f64c1280a7ee0cf36c6c6d76b5749dd782fbcc14f113961bf AS linux
1010
COPY --from=iptables /usr/sbin/*tables* /usr/sbin/
1111
COPY --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
1313
ENTRYPOINT [ "/usr/local/bin/azure-cns" ]
1414
EXPOSE 10090
1515

1616

1717
# mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
1818
FROM --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
2222
ENTRYPOINT ["azure-cns.exe"]
2323
EXPOSE 10090
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG ARCHIVE_DIR
1+
ARG ARTIFACT_DIR
22

33
FROM 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
88
CMD ["/ipv6-hp-bpf"]

.pipelines/build/images.jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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 }}

.pipelines/build/scripts/cni.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export GOOS=$OS
1010
export GOARCH=$ARCH
1111
export CGO_ENABLED=0
1212

13-
CNI_BUILD_DIR="$BUILD_DIR"/cni
13+
CNI_BUILD_DIR="$REPO_ROOT"/cni
1414
STATELESS_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

2222
CNI_TEMP_DIR=$(mktemp -d -p "$GEN_DIR")
2323

.pipelines/build/scripts/cns.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/bin/bash
22
set -nex
33

4+
export GOOS=$OS
5+
export GOARCH=$ARCH
6+
export CGO_ENABLED=0
7+
48
mkdir -p "$OUT_DIR"/files
59
mkdir -p "$OUT_DIR"/bins
610

711
pushd "$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

0 commit comments

Comments
 (0)