1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-26 15:16:27 +01:00

Updates with UPX with cross compile (#1817)

* Revert "Removes UXP"

* Updates UPX again to be cross-compile
This commit is contained in:
Amir Raminfar
2022-07-21 09:53:55 -07:00
committed by GitHub
parent 84ae558467
commit 400cef767f
2 changed files with 6 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ jobs:
uses: docker/build-push-action@v3.1.0
with:
push: true
platforms: linux/amd64
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
build-args: TAG=${{ steps.meta.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -46,13 +46,17 @@ ARG TARGETOS TARGETARCH
# Build binary
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=$TAG" -o dozzle
# Use UPX to make the binary smaller
FROM --platform=$BUILDPLATFORM 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
HEALTHCHECK --start-period=4s --interval=2s CMD [ "/dozzle", "healthcheck" ]