From a7b143f953b20a759bd89ded90f79e1d6b6fd65d Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Tue, 28 Apr 2026 15:36:02 -0400 Subject: [PATCH 1/2] Remove rhel8 build stage from Dockerfile.openshift The rhel8 builder stage and its corresponding COPY are no longer needed. Co-Authored-By: Claude Opus 4.6 rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --- Dockerfile.openshift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index e75b0907..6a44d27f 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -3,16 +3,9 @@ WORKDIR /go/src/github.com/openshift/bond-cni COPY . . RUN ./build.sh -FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.26-openshift-5.0 AS rhel8 -WORKDIR /go/src/github.com/openshift/bond-cni -COPY . . -RUN ./build.sh - FROM registry.ci.openshift.org/ocp/5.0:base-rhel9 LABEL io.k8s.display-name="bond-cni" \ io.k8s.description="This is an image containing the bond-cni executable" \ io.openshift.tags="openshift" -COPY --from=rhel9 /go/src/github.com/openshift/bond-cni/bin/bond /bondcni/rhel9/bond COPY --from=rhel9 /go/src/github.com/openshift/bond-cni/bin/bond /bondcni/bond -COPY --from=rhel8 /go/src/github.com/openshift/bond-cni/bin/bond /bondcni/rhel8/bond From 2ba8bc50c29f6359219f018cf1d831296b06bb5f Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Tue, 28 Apr 2026 15:40:49 -0400 Subject: [PATCH 2/2] Strip debug symbols from the bond binary Pass -ldflags '-s -w' to go build to strip the symbol table and DWARF debug information, reducing the binary size. Co-Authored-By: Claude Opus 4.6 rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 13ee3440..e69dba74 100755 --- a/build.sh +++ b/build.sh @@ -20,4 +20,4 @@ set -e echo "Building bond-cni plugins" export GO111MODULE=on -go build --mod=vendor -o ./bin/bond ./bond/ +go build --mod=vendor -ldflags '-s -w' -o ./bin/bond ./bond/