Skip to content

Commit 3efb67a

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

File tree

11 files changed

+31
-19
lines changed

11 files changed

+31
-19
lines changed

.pipelines/build/dockerfiles/azure-ipam.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG ARTIFACT_DIR
22

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

77

.pipelines/build/dockerfiles/cni.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG ARCH
22
ARG ARTIFACT_DIR
33

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

88

.pipelines/build/dockerfiles/cns.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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.exe /usr/local/bin/azure-cns
12+
COPY ${ARTIFACT_DIR}/bin/azure-cns.bin /usr/local/bin/azure-cns
1313
ENTRYPOINT [ "/usr/local/bin/azure-cns" ]
1414
EXPOSE 10090
1515

.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.exe /ipv6-hp-bpf
6-
COPY ${ARTIFACT_DIR}/bin/nft.exe /usr/sbin/nft
7-
COPY ${ARTIFACT_DIR}/bin/ip.exe /sbin/ip
5+
COPY ${ARTIFACT_DIR}/bin/ipv6-hp-bpf.bin /ipv6-hp-bpf
6+
COPY ${ARTIFACT_DIR}/bin/nft.bin /usr/sbin/nft
7+
COPY ${ARTIFACT_DIR}/bin/ip.bin /sbin/ip
88
CMD ["/ipv6-hp-bpf"]

.pipelines/build/dockerfiles/npm.Dockerfile

Lines changed: 1 addition & 1 deletion
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.exe /usr/bin/azure-npm
10+
COPY ${ARTIFACT_DIR}/bin/azure-npm.bin /usr/bin/azure-npm
1111
RUN chmod +x /usr/bin/azure-npm
1212
ENTRYPOINT ["/usr/bin/azure-npm", "start"]
1313

.pipelines/build/scripts/azure-ipam.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4+
[[ $OS =~ windows ]] && FILE_EXT='exe' || FILE_EXT='bin'
5+
46
export GOOS=$OS
57
export GOARCH=$ARCH
68
export CGO_ENABLED=0
@@ -10,7 +12,7 @@ mkdir -p "$OUT_DIR"/files
1012

1113
pushd "$REPO_ROOT"/azure-ipam
1214
go build -v -a -trimpath \
13-
-o "$OUT_DIR"/bin/azure-ipam \
15+
-o "$OUT_DIR"/bin/azure-ipam."$FILE_EXT" \
1416
-ldflags "-X github.com/Azure/azure-container-networking/azure-ipam/internal/buildinfo.Version="$AZURE_IPAM_VERSION" -X main.version="$AZURE_IPAM_VERSION"" \
1517
-gcflags="-dwarflocationlists=true" \
1618
.

.pipelines/build/scripts/cni.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4+
[[ $OS =~ windows ]] && FILE_EXT='exe' || FILE_EXT='bin'
5+
46
mkdir -p "$OUT_DIR"/files
57
mkdir -p "$OUT_DIR"/bin
68

@@ -12,7 +14,7 @@ export CGO_ENABLED=0
1214
CNI_NET_DIR="$REPO_ROOT"/cni/network/plugin
1315
pushd "$CNI_NET_DIR"
1416
go build -v -a -trimpath \
15-
-o "$OUT_DIR"/bin/azure-vnet.exe \
17+
-o "$OUT_DIR"/bin/azure-vnet."$FILE_EXT" \
1618
-ldflags "-X main.version="$CNI_VERSION"" \
1719
-gcflags="-dwarflocationlists=true" \
1820
./main.go
@@ -21,7 +23,7 @@ popd
2123
STATELESS_CNI_BUILD_DIR="$REPO_ROOT"/cni/network/stateless
2224
pushd "$STATELESS_CNI_BUILD_DIR"
2325
go build -v -a -trimpath \
24-
-o "$OUT_DIR"/bin/azure-vnet-stateless.exe \
26+
-o "$OUT_DIR"/bin/azure-vnet-stateless."$FILE_EXT" \
2527
-ldflags "-X main.version="$CNI_VERSION"" \
2628
-gcflags="-dwarflocationlists=true" \
2729
./main.go
@@ -30,7 +32,7 @@ popd
3032
CNI_IPAM_DIR="$REPO_ROOT"/cni/ipam/plugin
3133
pushd "$CNI_IPAM_DIR"
3234
go build -v -a -trimpath \
33-
-o "$OUT_DIR"/bin/azure-vnet-ipam.exe \
35+
-o "$OUT_DIR"/bin/azure-vnet-ipam."$FILE_EXT" \
3436
-ldflags "-X main.version="$CNI_VERSION"" \
3537
-gcflags="-dwarflocationlists=true" \
3638
./main.go
@@ -39,7 +41,7 @@ popd
3941
CNI_IPAMV6_DIR="$REPO_ROOT"/cni/ipam/pluginv6
4042
pushd "$CNI_IPAMV6_DIR"
4143
go build -v -a -trimpath \
42-
-o "$OUT_DIR"/bin/azure-vnet-ipamv6.exe \
44+
-o "$OUT_DIR"/bin/azure-vnet-ipamv6."$FILE_EXT" \
4345
-ldflags "-X main.version="$CNI_VERSION"" \
4446
-gcflags="-dwarflocationlists=true" \
4547
./main.go
@@ -48,7 +50,7 @@ popd
4850
CNI_TELEMETRY_DIR="$REPO_ROOT"/cni/telemetry/service
4951
pushd "$CNI_TELEMETRY_DIR"
5052
go build -v -a -trimpath \
51-
-o "$OUT_DIR"/bin/azure-vnet-telemetry.exe \
53+
-o "$OUT_DIR"/bin/azure-vnet-telemetry."$FILE_EXT" \
5254
-ldflags "-X main.version="$CNI_VERSION" -X "$CNI_AI_PATH"="$CNI_AI_ID"" \
5355
-gcflags="-dwarflocationlists=true" \
5456
./telemetrymain.go

.pipelines/build/scripts/cns.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4+
[[ $OS =~ windows ]] && FILE_EXT='exe' || FILE_EXT='bin'
5+
46
export GOOS=$OS
57
export GOARCH=$ARCH
68
export CGO_ENABLED=0
@@ -11,7 +13,7 @@ mkdir -p "$OUT_DIR"/scripts
1113

1214
pushd "$REPO_ROOT"/cns
1315
go build -v -a \
14-
-o "$OUT_DIR"/bin/azure-cns.exe \
16+
-o "$OUT_DIR"/bin/azure-cns."$FILE_EXT" \
1517
-ldflags "-X main.version="$CNS_VERSION" -X "$CNS_AI_PATH"="$CNS_AI_ID"" \
1618
-gcflags="-dwarflocationlists=true" \
1719
service/*.go

.pipelines/build/scripts/dropgz.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4+
[[ $OS =~ windows ]] && FILE_EXT='exe' || FILE_EXT='bin'
5+
46
export GOOS=$OS
57
export GOARCH=$ARCH
68
export CGO_ENABLED=0
@@ -43,7 +45,7 @@ echo >&2 "##[section]Build DropGZ with Embedded Payload"
4345
pushd "$DROPGZ_BUILD_DIR"/pkg/mod/"$DROPGZ_MOD_DOWNLOAD_PATH"
4446
mv "$PAYLOAD_DIR"/* pkg/embed/fs/
4547
go build -v -trimpath -a \
46-
-o "$OUT_DIR"/bin/dropgz.exe \
48+
-o "$OUT_DIR"/bin/dropgz."$FILE_EXT" \
4749
-ldflags "-X github.com/Azure/azure-container-networking/dropgz/internal/buildinfo.Version="$DROPGZ_VERSION"" \
4850
-gcflags="-dwarflocationlists=true" \
4951
main.go

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4+
[[ $OS =~ windows ]] && FILE_EXT='exe' || FILE_EXT='bin'
5+
46
export GOOS=$OS
57
export GOARCH=$ARCH
68
export CGO_ENABLED=0
@@ -68,8 +70,8 @@ cp /lib/"$ARCH"/libbsd.so.0 "$OUT_DIR"/lib/
6870
cp /lib/"$ARCH"/libmd.so.0 "$OUT_DIR"/lib/
6971

7072
# Add Needed Binararies
71-
cp /usr/sbin/nft "$OUT_DIR"/bin/nft.exe
72-
cp /sbin/ip "$OUT_DIR"/bin/ip.exe
73+
cp /usr/sbin/nft "$OUT_DIR"/bin/nft."$FILE_EXT"
74+
cp /sbin/ip "$OUT_DIR"/bin/ip."$FILE_EXT"
7375

7476

7577
# Build IPv6 HP BPF
@@ -82,7 +84,7 @@ pushd "$REPO_ROOT"/bpf-prog/ipv6-hp-bpf
8284

8385
go generate ./...
8486
go build -v -a -trimpath \
85-
-o "$OUT_DIR"/bin/ipv6-hp-bpf.exe \
87+
-o "$OUT_DIR"/bin/ipv6-hp-bpf."$FILE_EXT" \
8688
-ldflags "-X main.version="$IPV6_HP_BPF_VERSION"" \
8789
-gcflags="-dwarflocationlists=true" .
8890
popd

0 commit comments

Comments
 (0)