From 0e486f1eed16ff88ad352f6fcb3ee7b81d220f67 Mon Sep 17 00:00:00 2001 From: bmf-san Date: Fri, 21 Apr 2023 00:06:13 +0900 Subject: [PATCH] [fix] --- app/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 9f0003b..00cf8b6 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -2,19 +2,19 @@ FROM golang:1.17.1-alpine as builder WORKDIR /go/gobel-client-example/app +ARG TARGETPLATFORM +ARG TARGETOS +ARG TARGETARCH + COPY . . RUN apk update && \ apk upgrade && \ apk add --no-cache libc-dev gcc git openssh openssl bash -ENV CGO_ENABLED=0 -ENV GOOS=linux -ENV GOARCH=${TARGETARCH} - -RUN go build -o app +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o app -FROM --platform=$BUILDPLATFORM alpine +FROM --platform=$TARGETPLATFORM alpine COPY --from=builder /go/gobel-client-example/app ./