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:
2
.github/workflows/dev.yml
vendored
2
.github/workflows/dev.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -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" ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user