Skip to content

Commit 989f9a4

Browse files
authored
Update dockerfile to add TARGETARCH (#1097)
Signed-off-by: Varsha B <vab@redhat.com>
1 parent 46358a8 commit 989f9a4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ COPY controllers/ controllers/
1616
COPY common/ common/
1717
COPY version/ version/
1818

19-
# Build
20-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager ./cmd/main.go
19+
# Build - Use TARGETARCH to build for the correct architecture
20+
ARG TARGETARCH
21+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o manager ./cmd/main.go
2122

2223
# Use distroless as minimal base image to package the manager binary
2324
# Refer to https://github.com/GoogleContainerTools/distroless for more details

0 commit comments

Comments
 (0)