Skip to content

Commit

Permalink
fix: multiarch docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufhm committed Oct 21, 2024
1 parent da2056b commit 4309421
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ ADD . $GOPATH/src/github.com/salsadigitalauorg/shipshape/

WORKDIR $GOPATH/src/github.com/salsadigitalauorg/shipshape

ENV CGO_ENABLED 0
ENV CGO_ENABLED=0

ARG TARGETOS TARGETARCH

RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} && \
go mod tidy && \
RUN go mod tidy && \
go generate ./... && \
go build -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT}" -o build/shipshape
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
-ldflags="-s -w -X main.version=${VERSION} \
-X main.commit=${COMMIT}" -o build/shipshape

FROM scratch

Expand Down

0 comments on commit 4309421

Please sign in to comment.