Statically link CNI plugins

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2025-02-10 10:21:21 -05:00
parent 16e2408ba3
commit 28751ecb1e

View File

@@ -176,7 +176,7 @@ RUN git clone --filter=tree:0 "${CNI_PLUGINS_CLONE_URL}" /cni-plugins \
&& eval "$(gimme "${GO_VERSION}")" \ && eval "$(gimme "${GO_VERSION}")" \
&& export GOTOOLCHAIN="go${GO_VERSION}" \ && export GOTOOLCHAIN="go${GO_VERSION}" \
&& mkdir ./bin \ && mkdir ./bin \
&& export GOARCH=$TARGETARCH && export CC=$(target-cc) && export CGO_ENABLED=1 \ && export GOARCH=$TARGETARCH && export CC=$(target-cc) && export CGO_ENABLED=0 \
&& go build -o ./bin/host-local -mod=vendor ./plugins/ipam/host-local \ && go build -o ./bin/host-local -mod=vendor ./plugins/ipam/host-local \
&& go build -o ./bin/loopback -mod=vendor ./plugins/main/loopback \ && go build -o ./bin/loopback -mod=vendor ./plugins/main/loopback \
&& go build -o ./bin/ptp -mod=vendor ./plugins/main/ptp \ && go build -o ./bin/ptp -mod=vendor ./plugins/main/ptp \