Skip to content

Commit

Permalink
fix: build arm binary
Browse files Browse the repository at this point in the history
  • Loading branch information
chuhlomin committed Dec 10, 2023
1 parent 7ee32fd commit a473db6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM --platform=$BUILDPLATFORM golang:1.17 as build-env
FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.17 as build-env

WORKDIR /go/src/app
ADD . /go/src/app

RUN go test -mod=vendor -cover ./...
RUN go build -mod=vendor -o /go/bin/app
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -mod=vendor -o /go/bin/app


FROM --platform=$BUILDPLATFORM gcr.io/distroless/static:966f4bd97f611354c4ad829f1ed298df9386c2ec
FROM --platform=${TARGETPLATFORM:-linux/amd64} gcr.io/distroless/static:966f4bd97f611354c4ad829f1ed298df9386c2ec
# latest-amd64 -> 966f4bd97f611354c4ad829f1ed298df9386c2ec
# https://github.com/GoogleContainerTools/distroless/tree/master/base

Expand Down

0 comments on commit a473db6

Please sign in to comment.