Skip to content

Commit

Permalink
Add multi-arch Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Dec 20, 2020
1 parent 2884a80 commit 3ba2762
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
FROM golang:1.15-alpine as builder

ARG TARGETPLATFORM

WORKDIR /workspace

# copy modules manifests
COPY go.mod go.mod
COPY go.sum go.sum

# cache modules
RUN go mod download

# copy source code
COPY cmd/ cmd/
COPY pkg/ pkg/

# build
RUN CGO_ENABLED=0 go build -a -o flagger ./cmd/flagger

FROM alpine:3.12

RUN apk --no-cache add ca-certificates

USER nobody

COPY --chown=nobody:nobody /bin/flagger .
COPY --from=builder --chown=nobody:nobody /workspace/flagger .

ENTRYPOINT ["./flagger"]

0 comments on commit 3ba2762

Please sign in to comment.