From 8a0f6598b3c325aee74eccd42444732516fa98d3 Mon Sep 17 00:00:00 2001 From: "VanCuren, Logan" Date: Tue, 29 Nov 2022 10:05:33 -0800 Subject: [PATCH] Strip symbol table and debug info to reduce the size of release docker image. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3faac2e..51fff03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN go mod download COPY . . RUN go test -cover ./... -RUN go build -a -tags netgo -installsuffix netgo -ldflags "-X github.com/halverneus/static-file-server/cli/version.version=${VERSION}" -o /serve /build/bin/serve +RUN go build -a -tags netgo -installsuffix netgo -ldflags "-s -w -X github.com/halverneus/static-file-server/cli/version.version=${VERSION}" -o /serve /build/bin/serve RUN adduser --system --no-create-home --uid 1000 --shell /usr/sbin/nologin static