chore: slimmer docker base image & binary (#29)
All checks were successful
CD / test (push) Successful in 2m26s
CD / Build and push (amd64) (push) Successful in 1m37s
CD / Build and push (arm64) (push) Successful in 3m54s
CD / Create manifest (push) Successful in 11s

Reduction of 352 MiB -> 8.22 MiB

Reviewed-on: #29
Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #29.
This commit is contained in:
2025-02-16 20:27:29 +01:00
committed by t.behrendt
parent ccf4f5dbbb
commit ad20ad46b0
2 changed files with 9 additions and 7 deletions

View File

@@ -76,6 +76,7 @@ jobs:
platforms: linux/${{ matrix.arch }}
push: true
provenance: false
build-args: GOARCH=${{ matrix.arch }}
tags: |
${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }}

View File

@@ -1,13 +1,14 @@
FROM golang:1.23-alpine
FROM golang:1.23-alpine as build
ARG GOARCH=amd64
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} \
go build -trimpath -ldflags="-s -w" -o main .
RUN go build -o main .
CMD ["./main"]
FROM gcr.io/distroless/static-debian12
COPY --from=build /app/main /
CMD ["/main"]