From c1059e2d4a6f8c9c0c7d3b9fca8d04ecaf124e34 Mon Sep 17 00:00:00 2001 From: Reese Norris Date: Tue, 22 Oct 2024 16:14:37 -0700 Subject: [PATCH] fix dockerfile --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2b445c5..9e93f08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ WORKDIR /go/src/openfsd # Add the sources COPY . . +# Download modules +RUN go mod download + # Compile RUN mkdir -p build && CGO_ENABLED=0 GOOS=linux go build -v -o build/openfsd -ldflags "-s -w" main.go @@ -23,7 +26,7 @@ RUN mkdir -p build && CGO_ENABLED=0 GOOS=linux go build -v -o build/openfsd -ldf COPY --from=upx /bin/upx /bin/upx # Compress with upx -RUN /bin/upx -v -9 openfsd +RUN upx -v -9 build/openfsd # Final distroless image FROM gcr.io/distroless/static-debian12