diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index b81c85c7..e32913a1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index e28bc1db..111b8811 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ]