From 53fdd0f91eab2a09ef3534434eeabf37e215b87e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 26 Dec 2023 19:11:25 +0100 Subject: [PATCH] Update dockerfile --- Dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa6e136..20d7400 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,9 @@ -# Build -FROM golang:1.18 AS builder - +FROM golang:latest AS build COPY . /otpauth WORKDIR /otpauth +ENV CGO_ENABLED=0 +RUN go build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/otpauth - -# Run FROM scratch - -COPY --from=builder /otpauth/build/otpauth /app/otpauth - +COPY --from=build /otpauth/otpauth /app/otpauth ENTRYPOINT ["/app/otpauth"]