chore: slimmer docker base image & binary #29

Merged
t.behrendt merged 2 commits from chore-slimmer-docker-base-image into main 2025-02-16 20:27:30 +01:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit e56df3a4da - Show all commits

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