Uses UPX to shrink binary (#1809)

* Tries to use UPX

* Uses harshavardhanj/upx instead
This commit is contained in:
Amir Raminfar
2022-07-17 10:22:23 -07:00
committed by GitHub
parent 07135fea91
commit 23b37bb912

View File

@@ -44,12 +44,17 @@ ARG TAG=dev
# Build binary
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$TAG" -o dozzle
# Use UPX to make the binary smaller
FROM harshavardhanj/upx:3.95 as upx
COPY --from=builder /dozzle/dozzle /dozzle
RUN upx --best --lzma /dozzle
FROM scratch
ENV PATH /bin
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /dozzle/dozzle /dozzle
COPY --from=upx /dozzle /dozzle
EXPOSE 8080