From f265e26f489a287988cb84ca21545cee67a41db6 Mon Sep 17 00:00:00 2001 From: TP Honey Date: Mon, 1 Jul 2024 15:34:59 +0100 Subject: [PATCH] maint: reduce binary size in docker image --- build/package/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package/Dockerfile b/build/package/Dockerfile index 1c3bdc0..77c2b40 100644 --- a/build/package/Dockerfile +++ b/build/package/Dockerfile @@ -20,7 +20,7 @@ COPY sources/ sources/ # Build RUN --mount=type=cache,target=/root/.cache/go-build \ - GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o source main.go + GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-s -w" -trimpath -o source main.go # Use distroless as minimal base image to package the source binary # Refer to https://github.com/GoogleContainerTools/distroless for more details