Skip to content

Commit 828b3ab

Browse files
committed
fixup! Use Signed Binaries for Docker Build
1 parent ee182d2 commit 828b3ab

File tree

10 files changed

+39
-35
lines changed

10 files changed

+39
-35
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
ARG ARTIFACT_DIR
22

33
FROM scratch AS linux
4-
COPY ${ARTIFACT_DIR}/bin/dropgz dropgz
4+
COPY ${ARTIFACT_DIR}/bin/dropgz.exe dropgz
55
ENTRYPOINT [ "/dropgz" ]
66

77

88
# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}"
99
FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows
10-
COPY ${ARTIFACT_DIR}/bin/dropgz dropgz.exe
10+
COPY ${ARTIFACT_DIR}/bin/dropgz.exe dropgz.exe
1111
ENTRYPOINT [ "/dropgz.exe" ]

.pipelines/build/dockerfiles/cni.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ ARG ARCH
22
ARG ARTIFACT_DIR
33

44
FROM scratch AS linux
5-
ADD ${ARTIFACT_DIR}/bin/dropgz dropgz
5+
ADD ${ARTIFACT_DIR}/bin/dropgz.exe dropgz
66
ENTRYPOINT [ "/dropgz" ]
77

88

99
# mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
1010
FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as hpc
1111

1212
FROM hpc as windows
13-
ADD ${ARTIFACT_DIR}/bin/dropgz dropgz.exe
13+
ADD ${ARTIFACT_DIR}/bin/dropgz.exe dropgz.exe
1414
ENTRYPOINT [ "/dropgz.exe" ]
15-
16-

.pipelines/build/dockerfiles/cns.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 ${ARTIFACT_DIR}/bin/azure-cns /usr/local/bin/azure-cns
12+
COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /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
1919
COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
20-
COPY ${ARTIFACT_DIR}/files/setkubeconfigpath.ps1 setkubeconfigpath.ps1
21-
COPY ${ARTIFACT_DIR}/bin/azure-cns /azure-cns.exe
20+
COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1
21+
COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe
2222
ENTRYPOINT ["azure-cns.exe"]
2323
EXPOSE 10090

.pipelines/build/dockerfiles/ipv6-hp-bpf.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG ARTIFACT_DIR
22

33
FROM mcr.microsoft.com/cbl-mariner/distroless/minimal:2.0 AS linux
44
COPY ${ARTIFACT_DIR}/lib/* /lib
5-
COPY ${ARTIFACT_DIR}/bin/ipv6-hp-bpf /ipv6-hp-bpf
6-
COPY ${ARTIFACT_DIR}/bin/nft /usr/sbin/nft
7-
COPY ${ARTIFACT_DIR}/bin/ip /sbin/ip
5+
COPY ${ARTIFACT_DIR}/bin/ipv6-hp-bpf.exe /ipv6-hp-bpf
6+
COPY ${ARTIFACT_DIR}/bin/nft.exe /usr/sbin/nft
7+
COPY ${ARTIFACT_DIR}/bin/ip.exe /sbin/ip
88
CMD ["/ipv6-hp-bpf"]

.pipelines/build/dockerfiles/npm.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN apt-get update && \
77
apt-get autoremove -y && \
88
apt-get clean
99

10-
COPY ${ARTIFACT_DIR}/bin/azure-npm /usr/bin/azure-npm
10+
COPY ${ARTIFACT_DIR}/bin/azure-npm.exe /usr/bin/azure-npm
1111
RUN chmod +x /usr/bin/azure-npm
1212
ENTRYPOINT ["/usr/bin/azure-npm", "start"]
1313

@@ -16,8 +16,8 @@ ENTRYPOINT ["/usr/bin/azure-npm", "start"]
1616
FROM mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as windows
1717

1818
COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
19-
COPY ${ARTIFACT_DIR}/files/setkubeconfigpath.ps1 setkubeconfigpath.ps1
20-
COPY ${ARTIFACT_DIR}/files/setkubeconfigpath-capz.ps1 setkubeconfigpath-capz.ps1
21-
COPY ${ARTIFACT_DIR}/bin/azure-npm npm.exe
19+
COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1
20+
COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath-capz.ps1 setkubeconfigpath-capz.ps1
21+
COPY ${ARTIFACT_DIR}/bin/azure-npm.exe npm.exe
2222

2323
CMD ["npm.exe", "start" "--kubeconfig=.\\kubeconfig"]

.pipelines/build/scripts/cni.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export CGO_ENABLED=0
1212
CNI_NET_DIR="$REPO_ROOT"/cni/network/plugin
1313
pushd "$CNI_NET_DIR"
1414
go build -v -a -trimpath \
15-
-o "$OUT_DIR"/bin/azure-vnet \
15+
-o "$OUT_DIR"/bin/azure-vnet.exe \
1616
-ldflags "-X main.version="$CNI_VERSION"" \
1717
-gcflags="-dwarflocationlists=true" \
1818
./main.go
@@ -21,7 +21,7 @@ popd
2121
STATELESS_CNI_BUILD_DIR="$REPO_ROOT"/cni/network/stateless
2222
pushd "$STATELESS_CNI_BUILD_DIR"
2323
go build -v -a -trimpath \
24-
-o "$OUT_DIR"/bin/azure-vnet-stateless \
24+
-o "$OUT_DIR"/bin/azure-vnet-stateless.exe \
2525
-ldflags "-X main.version="$CNI_VERSION"" \
2626
-gcflags="-dwarflocationlists=true" \
2727
./main.go
@@ -30,7 +30,7 @@ popd
3030
CNI_IPAM_DIR="$REPO_ROOT"/cni/ipam/plugin
3131
pushd "$CNI_IPAM_DIR"
3232
go build -v -a -trimpath \
33-
-o "$OUT_DIR"/bin/azure-vnet-ipam \
33+
-o "$OUT_DIR"/bin/azure-vnet-ipam.exe \
3434
-ldflags "-X main.version="$CNI_VERSION"" \
3535
-gcflags="-dwarflocationlists=true" \
3636
./main.go
@@ -39,7 +39,7 @@ popd
3939
CNI_IPAMV6_DIR="$REPO_ROOT"/cni/ipam/pluginv6
4040
pushd "$CNI_IPAMV6_DIR"
4141
go build -v -a -trimpath \
42-
-o "$OUT_DIR"/bin/azure-vnet-ipamv6 \
42+
-o "$OUT_DIR"/bin/azure-vnet-ipamv6.exe \
4343
-ldflags "-X main.version="$CNI_VERSION"" \
4444
-gcflags="-dwarflocationlists=true" \
4545
./main.go
@@ -48,7 +48,7 @@ popd
4848
CNI_TELEMETRY_DIR="$REPO_ROOT"/cni/telemetry/service
4949
pushd "$CNI_TELEMETRY_DIR"
5050
go build -v -a -trimpath \
51-
-o "$OUT_DIR"/bin/azure-vnet-telemetry \
51+
-o "$OUT_DIR"/bin/azure-vnet-telemetry.exe \
5252
-ldflags "-X main.version="$CNI_VERSION" -X "$CNI_AI_PATH"="$CNI_AI_ID"" \
5353
-gcflags="-dwarflocationlists=true" \
5454
./telemetrymain.go

.pipelines/build/scripts/cns.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ export CGO_ENABLED=0
77

88
mkdir -p "$OUT_DIR"/files
99
mkdir -p "$OUT_DIR"/bin
10+
mkdir -p "$OUT_DIR"/scripts
1011

1112
pushd "$REPO_ROOT"/cns
1213
go build -v -a \
13-
-o "$OUT_DIR"/bin/azure-cns \
14+
-o "$OUT_DIR"/bin/azure-cns.exe \
1415
-ldflags "-X main.version="$CNS_VERSION" -X "$CNS_AI_PATH"="$CNS_AI_ID"" \
1516
-gcflags="-dwarflocationlists=true" \
1617
service/*.go
1718
cp kubeconfigtemplate.yaml "$OUT_DIR"/files/kubeconfigtemplate.yaml
18-
cp ../npm/examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/files/setkubeconfigpath.ps1
1919
cp configuration/cns_config.json "$OUT_DIR"/files/cns_config.json
20+
cp ../npm/examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/scripts/setkubeconfigpath.ps1
2021
popd

.pipelines/build/scripts/dropgz.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ mkdir -p "$DROPGZ_BUILD_DIR"
1919
echo >&2 "##[section]Construct DropGZ Embedded Payload"
2020
pushd "$PAYLOAD_DIR"
2121
[[ -n $(stat "$OUT_DIR"/files 2>/dev/null || true) ]] && cp "$OUT_DIR"/files/* .
22+
[[ -n $(stat "$OUT_DIR"/scripts 2>/dev/null || true) ]] && cp "$OUT_DIR"/scripts/* .
2223
[[ -n $(stat "$OUT_DIR"/bin 2>/dev/null || true) ]] && cp "$OUT_DIR"/bin/* .
2324

2425
sha256sum * > sum.txt
@@ -42,7 +43,7 @@ echo >&2 "##[section]Build DropGZ with Embedded Payload"
4243
pushd "$DROPGZ_BUILD_DIR"/pkg/mod/"$DROPGZ_MOD_DOWNLOAD_PATH"
4344
mv "$PAYLOAD_DIR"/* pkg/embed/fs/
4445
go build -v -trimpath -a \
45-
-o "$OUT_DIR"/bin/dropgz \
46+
-o "$OUT_DIR"/bin/dropgz.exe \
4647
-ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$DROPGZ_VERSION"" \
4748
-gcflags="-dwarflocationlists=true" \
4849
main.go

.pipelines/build/scripts/ipv6-hp-bpf.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ mkdir -p "$OUT_DIR"/lib
1212
# Package up Needed C Files
1313
if [[ -f /etc/debian_version ]];then
1414
apt-get update -y
15+
apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2
1516
if [[ $ARCH =~ amd64 ]]; then
16-
apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2 gcc-multilib build-essential binutils
17+
apt-get install -y gcc-multilib build-essential binutils
1718

1819
ARCH=x86_64-linux-gnu
1920
cp /usr/lib/"$ARCH"/ld-linux-x86-64.so.2 "$OUT_DIR"/lib/
2021

2122
elif [[ $ARCH =~ arm64 ]]; then
22-
apt-get install -y llvm clang linux-libc-dev linux-headers-generic libbpf-dev libc6-dev nftables iproute2 gcc-aarch64-linux-gnu
23+
apt-get install -y gcc-aarch64-linux-gnu
2324

2425
ARCH=aarch64-linux-gnu
2526
cp /usr/lib/"$ARCH"/ld-linux-aarch64.so.1 "$OUT_DIR"/lib/
@@ -32,13 +33,15 @@ if [[ -f /etc/debian_version ]];then
3233

3334
# Mariner
3435
else
35-
tdnf install -y llvm clang libbpf-devel nftables gcc binutils iproute glibc-devel
36+
tdnf install -y llvm clang libbpf-devel nftables gcc binutils iproute cross-gcc
3637
if [[ $ARCH =~ amd64 ]]; then
3738
ARCH=x86_64-linux-gnu
38-
cp /usr/lib/"$ARCH"/ld-linux-x86-64.so.2 "$OUT_DIR"/lib/
39+
#tdnf install -y gcc-x86_64-linux-gnu
40+
cp /usr/lib/"$ARCH"/ld-linux-x86-64.so.2 "$OUT_DIR"/lib/ || find /usr/lib/ -name 'ld-linux-x86-64.so.2'
3941
elif [[ $ARCH =~ arm64 ]]; then
4042
ARCH=aarch64-linux-gnu
41-
cp /usr/lib/"$ARCH"/ld-linux-aarch64.so.1 "$OUT_DIR"/lib/
43+
#tdnf install -y gcc-aarch64-linux-gnu
44+
cp /usr/lib/"$ARCH"/ld-linux-aarch64.so.1 "$OUT_DIR"/lib/ || find /usr/lib/ -name 'ld-linux-aarch64.so.1'
4245
fi
4346
for dir in /usr/include/"$ARCH"/*; do
4447
if [[ -d $dir ]]; then
@@ -65,8 +68,8 @@ cp /lib/"$ARCH"/libbsd.so.0 "$OUT_DIR"/lib/
6568
cp /lib/"$ARCH"/libmd.so.0 "$OUT_DIR"/lib/
6669

6770
# Add Needed Binararies
68-
cp /usr/sbin/nft "$OUT_DIR"/bin/nft
69-
cp /sbin/ip "$OUT_DIR"/bin/ip
71+
cp /usr/sbin/nft "$OUT_DIR"/bin/nft.exe
72+
cp /sbin/ip "$OUT_DIR"/bin/ip.exe
7073

7174

7275
# Build IPv6 HP BPF
@@ -79,7 +82,7 @@ pushd "$REPO_ROOT"/bpf-prog/ipv6-hp-bpf
7982

8083
go generate ./...
8184
go build -v -a -trimpath \
82-
-o "$OUT_DIR"/bin/ipv6-hp-bpf \
85+
-o "$OUT_DIR"/bin/ipv6-hp-bpf.exe \
8386
-ldflags "-X main.version="$IPV6_HP_BPF_VERSION"" \
8487
-gcflags="-dwarflocationlists=true" .
8588
popd

.pipelines/build/scripts/npm.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ export CGO_ENABLED=0
77

88
mkdir -p "$OUT_DIR"/files
99
mkdir -p "$OUT_DIR"/bin
10+
mkdir -p "$OUT_DIR"/scripts
1011

1112
pushd "$REPO_ROOT"/npm
1213
go build -a -v -trimpath \
13-
-o "$OUT_DIR"/bin/azure-npm \
14+
-o "$OUT_DIR"/bin/azure-npm.exe \
1415
-ldflags "-X main.version="$NPM_VERSION" -X "$NPM_AI_PATH"="$NPM_AI_ID"" \
1516
-gcflags="-dwarflocationlists=true" \
1617
./cmd/*.go
1718

1819
cp ./examples/windows/kubeconfigtemplate.yaml "$OUT_DIR"/files/kubeconfigtemplate.yaml
19-
cp ./examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/files/setkubeconfigpath.ps1
20-
cp ./examples/windows/setkubeconfigpath-capz.ps1 "$OUT_DIR"/files/setkubeconfigpath-capz.ps1
20+
cp ./examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/scripts/setkubeconfigpath.ps1
21+
cp ./examples/windows/setkubeconfigpath-capz.ps1 "$OUT_DIR"/scripts/setkubeconfigpath-capz.ps1
2122
popd

0 commit comments

Comments
 (0)