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 Apr 27, 2021
1 parent 09226a2 commit 1a8ce21
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 @@ -5,7 +5,7 @@ ADD . /build/


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

FROM scratch

Expand Down

0 comments on commit 1a8ce21

Please sign in to comment.