Skip to content

Commit

Permalink
Merge pull request #4 from eexit/compress-bin
Browse files Browse the repository at this point in the history
Compress binary using upx
  • Loading branch information
eexit authored Jun 1, 2021
2 parents 5a4d2f1 + b75263b commit 7278461
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM eexit/curl-healthchecker:v1.0.0 AS curl

FROM golang:1 AS builder
RUN update-ca-certificates
RUN apt-get update -y \
&& apt-get install -y upx \
&& update-ca-certificates
ARG version
ARG goos=linux
ARG goarch=amd64
Expand All @@ -13,6 +15,7 @@ RUN CGO_ENABLED=0 GOOS=${goos} GOARCH=${goarch} go build \
-ldflags "-X github.com/eexit/http2smtp/internal/api.Version=${version}" \
-o /http2smtp \
./cmd/http2smtp
RUN upx /http2smtp

FROM scratch
COPY --from=curl /curl /
Expand Down

0 comments on commit 7278461

Please sign in to comment.