Skip to content

Commit

Permalink
Merge pull request #81 from gschafra/multiarch-build
Browse files Browse the repository at this point in the history
ci: fix docker multi-arch build
  • Loading branch information
strider2038 authored Nov 29, 2022
2 parents a043e5b + c1d500b commit 7b7aded
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# build stage
FROM golang:alpine AS build-env
FROM --platform=$BUILDPLATFORM golang:alpine AS build-env

ARG APP_VERSION=""
ARG BUILD_TIME=""
ARG TARGETOS TARGETARCH

ADD . /project

Expand All @@ -16,7 +17,7 @@ RUN set -e \
&& cd /project \
&& go mod download \
&& cd /project/cmd/openapi-mock \
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.version=${APP_VERSION} -X main.buildTime=${BUILD_TIME}" -o openapi-mock \
&& CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-w -s -X main.version=${APP_VERSION} -X main.buildTime=${BUILD_TIME}" -o openapi-mock \
&& ls -la | grep "openapi-mock"

# final stage
Expand Down

0 comments on commit 7b7aded

Please sign in to comment.