Skip to content

Commit 90d69cf

Browse files
committed
📦 build(Dockerfile): add multi-architecture support for builds
- introduce TARGETARCH build argument to support different architectures - update GOARCH usage to rely on TARGETARCH for flexible builds
1 parent 7986954 commit 90d69cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ COPY cmd/ cmd/
1919
COPY pkg/ pkg/
2020

2121
# Build the ENI Controller with optimizations for size
22-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOTOOLCHAIN=${GOTOOLCHAIN} \
22+
# Use the TARGETARCH build arg to support multi-architecture builds
23+
ARG TARGETARCH=amd64
24+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GOTOOLCHAIN=${GOTOOLCHAIN} \
2325
go build -a -ldflags="-s -w" -trimpath -o manager cmd/main.go
2426

2527
# Build the ENI Manager with optimizations for size
26-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOTOOLCHAIN=${GOTOOLCHAIN} \
28+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GOTOOLCHAIN=${GOTOOLCHAIN} \
2729
go build -a -ldflags="-s -w" -trimpath -o eni-manager cmd/eni-manager/main.go
2830

2931
# Use UPX to compress the binaries

0 commit comments

Comments
 (0)