Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Commit

Permalink
Compile to native arch
Browse files Browse the repository at this point in the history
This is needed for ARM, where GOARCH is arm64 but the uname reports aarch64.
  • Loading branch information
yselkowitz committed Mar 18, 2021
1 parent 6e8ec09 commit a124628
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM image-registry.openshift-image-registry.svc:5000/openshift/golang:latest as
WORKDIR /build
ADD . /build/

RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .
RUN CGO_ENABLED=0 go build -mod=vendor -o api-server .

FROM scratch

Expand Down

0 comments on commit a124628

Please sign in to comment.