From 312c50a123dac4c373669a4f443ef55298a85fb0 Mon Sep 17 00:00:00 2001 From: Luca Corrieri Date: Mon, 13 Jan 2025 15:24:44 +0100 Subject: [PATCH 1/2] fix(docker): reduce burrito binary size --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b37844e5..4e1db071 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ COPY --from=builder-ui /workspace/dist internal/server/dist ARG VERSION ENV GOCACHE=/root/.cache/go-build RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a \ - -ldflags="\ + -ldflags="-w -s \ -X ${PACKAGE}/internal/version.Version=${VERSION} \ -X ${PACKAGE}/internal/version.CommitHash=${COMMIT_HASH} \ -X ${PACKAGE}/internal/version.BuildTimestamp=${BUILD_TIMESTAMP}" \ From b2ede639dd2be88967f29f3f59d6e66e4c798a4f Mon Sep 17 00:00:00 2001 From: Luca Corrieri Date: Mon, 13 Jan 2025 20:13:16 +0100 Subject: [PATCH 2/2] fix(docker): remove go build -a option --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4e1db071..1d908cdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ COPY --from=builder-ui /workspace/dist internal/server/dist # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. ARG VERSION ENV GOCACHE=/root/.cache/go-build -RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a \ +RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build \ -ldflags="-w -s \ -X ${PACKAGE}/internal/version.Version=${VERSION} \ -X ${PACKAGE}/internal/version.CommitHash=${COMMIT_HASH} \