Skip to content

Commit

Permalink
Don't compress dockerized binary
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom committed Mar 23, 2021
1 parent bb9fef4 commit 71bc657
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand Down

0 comments on commit 71bc657

Please sign in to comment.