Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.

Commit 9d9f9b7

Browse files
Waterdripsalexellis
authored andcommitted
Convert git-tar to multiarch
Signed-off-by: Alistair Hey <[email protected]>
1 parent 6f45189 commit 9d9f9b7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

git-tar/Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
FROM openfaas/faas-cli:0.12.8 as faas-cli
2-
FROM openfaas/classic-watchdog:0.18.17 as watchdog
3-
FROM golang:1.13-alpine3.12 as build
1+
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/faas-cli:0.12.19 as faas-cli
2+
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.4 as watchdog
3+
FROM --platform=${TARGETPLATFORM:-linux/amd64} golang:1.13-alpine3.12 as build
4+
5+
ARG TARGETPLATFORM
6+
ARG BUILDPLATFORM
7+
ARG TARGETOS
8+
ARG TARGETARCH
49

510
ENV CGO_ENABLED=0
611
ENV GO111MODULE=off
@@ -15,11 +20,11 @@ COPY . .
1520
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" \
1621
|| { echo "Run \"gofmt -s -w\" on your Golang code"; exit 1; }
1722

18-
RUN CGO_ENABLED=0 GOOS=linux \
19-
go build --ldflags "-s -w" -a -installsuffix cgo -o handler . && \
20-
go test $(go list ./... | grep -v /vendor/) -cover
23+
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
24+
go build --ldflags "-s -w" -a -installsuffix cgo -o handler .
25+
RUN go test $(go list ./... | grep -v /vendor/) -cover
2126

22-
FROM alpine:3.11 as ship
27+
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.12 as ship
2328

2429
RUN apk --no-cache add \
2530
ca-certificates \

0 commit comments

Comments
 (0)