From ed6b5685f629fb593029ed30fef03c2316f88ad0 Mon Sep 17 00:00:00 2001 From: mauricioromagnollo Date: Wed, 11 Oct 2023 23:39:38 -0300 Subject: [PATCH] fix: fix binary file path --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2e3a8aa..613652c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM golang:1.20.6 as builder +FROM golang:1.20.6 AS builder WORKDIR /app COPY . . -RUN GOOS=linux go build -ldflags="-w -s" -o bin/api cmd/api/main.go +RUN GOOS=linux go build -ldflags="-w -s" -o api cmd/api/main.go -FROM scratch -COPY --from=builder /app/bin/api . +FROM golang:1.20.6 AS final +WORKDIR / +COPY --from=builder /app/api . EXPOSE 8080 -CMD [ "./api" ] \ No newline at end of file +ENTRYPOINT ["/api"] \ No newline at end of file