@@ -36,9 +36,6 @@ stages:
3636 - bash : |
3737 set -ex
3838
39- # Clear Docker buildx cache to remove systemcrypto artifacts
40- docker buildx prune --all --force || true
41-
4239 cd .pipelines/
4340 git clone https://github.com/cilium/cilium.git
4441 cd cilium
@@ -71,21 +68,12 @@ stages:
7168 # Apply patch to Dockerfile
7269 DOCKERFILE_PATH="./images/$(directory)/Dockerfile"
7370 echo "Patching Dockerfile: $DOCKERFILE_PATH"
74-
75- # Check if we're using Microsoft Go image
76- if ! [ -z "$goMCR" ] && [[ "$goMCR" == *"microsoft"* ]]; then
77- echo "Applying nosystemcrypto patch for Microsoft Go build"
7871
79- # Add ARG and ENV statements to disable systemcrypto for Microsoft Go
80- sed -i '/^FROM.*builder/a ARG GOEXPERIMENT=boringcrypto \nENV GOEXPERIMENT=${GOEXPERIMENT}\nENV CGO_ENABLED=1' "$DOCKERFILE_PATH"
72+ # Add ARG and ENV statements to disable systemcrypto for Microsoft Go
73+ sed -i '/^FROM.*builder/a ARG GOEXPERIMENT=boringcrypto \nENV GOEXPERIMENT=${GOEXPERIMENT}\nENV CGO_ENABLED=1' "$DOCKERFILE_PATH"
8174
82- # Clear Go module and build caches completely, then rebuild everything with nosystemcrypto
83- sed -i '/ENV CGO_ENABLED=1/a RUN rm -rf /go/pkg /root/.cache && \\\n mkdir -p /go/pkg /tmp/gocache && \\\n cd /tmp && \\\n GOCACHE=/tmp/gocache CGO_ENABLED=1 go env && \\\n GOCACHE=/tmp/gocache CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go install -a -x std' "$DOCKERFILE_PATH"
84- else
85- echo "Using standard Go build - no GOEXPERIMENT patch needed"
86- # Just add CGO_ENABLED for consistency
87- sed -i '/^FROM.*builder/a ENV CGO_ENABLED=1' "$DOCKERFILE_PATH"
88- fi
75+ # Clear Go module and build caches completely, then rebuild everything with nosystemcrypto
76+ sed -i '/ENV CGO_ENABLED=1/a RUN rm -rf /go/pkg /root/.cache && \\\n mkdir -p /go/pkg /tmp/gocache && \\\n cd /tmp && \\\n GOCACHE=/tmp/gocache CGO_ENABLED=1 go env && \\\n GOCACHE=/tmp/gocache CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go install -a -x std' "$DOCKERFILE_PATH"
8977
9078 # Remove ALL cache mounts for /go/pkg and /root/.cache to avoid conflicts
9179 sed -i 's/--mount=type=cache,target=\/go\/pkg[[:space:]]*//g' "$DOCKERFILE_PATH"
@@ -95,10 +83,6 @@ stages:
9583 head -80 "$DOCKERFILE_PATH"
9684 fi
9785
98- # Create fresh builder with clean cache to avoid systemcrypto conflicts
99- docker buildx rm cilium-builder || true
100- docker buildx create --name cilium-builder --use --bootstrap
101-
10286 BUILD_ARGS=${GO_ARGS}${ALPINE_ARGS}
10387 DOCKER_FLAGS="$BUILD_ARGS" \
10488 make $(type)
0 commit comments