From 71bc6575613d8f6453ef67ee12d85091ef992cd5 Mon Sep 17 00:00:00 2001 From: Artyom Pervukhin Date: Tue, 23 Mar 2021 19:34:57 +0300 Subject: [PATCH] Don't compress dockerized binary --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 974fcaf..a66b85b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,13 @@ FROM golang:alpine AS builder -RUN apk add --update upx WORKDIR /app ENV GOPROXY=https://proxy.golang.org CGO_ENABLED=0 COPY go.mod go.sum ./ RUN go mod download COPY . ./ RUN test -s ci-version.txt && \ - go build -ldflags='-s -w' -o bitmapist-server \ + go build -trimpath -ldflags='-s -w' -o bitmapist-server \ -ldflags="-X=main.explicitVersion=$(cat ci-version.txt)" || \ - go build -ldflags='-s -w' -o bitmapist-server \ - && upx --lzma bitmapist-server + go build -trimpath -ldflags='-s -w' -o bitmapist-server FROM scratch COPY --from=builder /app/bitmapist-server .