Skip to content

Commit 1e29e0c

Browse files
authored
Project-clone multiarch support (#1396)
Changed the Dockerfile to support multiarch golang builds. Signed-off-by: Liran Rotenberg <[email protected]>
1 parent e330e9c commit 1e29e0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

project-clone/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# Build the manager binary
1717
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi9/go-toolset
1818
FROM registry.access.redhat.com/ubi9/go-toolset:9.5-1739267472 as builder
19+
ARG TARGETARCH
20+
ARG TARGETOS
1921
ENV GOPATH=/go/
2022
USER root
2123
WORKDIR /project-clone
@@ -30,7 +32,7 @@ RUN go mod download
3032
COPY . .
3133

3234
# compile workspace controller binaries
33-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build \
35+
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO111MODULE=on go build \
3436
-a -o _output/bin/project-clone \
3537
-gcflags all=-trimpath=/ \
3638
-asmflags all=-trimpath=/ \

0 commit comments

Comments
 (0)