2026-09-22 13:13:10 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
|
|
|
|
FROM golang:1.25-alpine AS build
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
|
|
# Cache module downloads (including the local certspotter fork's deps).
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
COPY third_party/certspotter/go.mod third_party/certspotter/go.sum ./third_party/certspotter/
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Static binary: no cgo, no shell, no writable filesystem required.
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build \
|
|
|
|
|
-trimpath -ldflags="-s -w" \
|
2026-09-22 17:48:30 +02:00
|
|
|
-o /out/bucketeer ./cmd/bucketeer
|
2026-09-22 13:13:10 +02:00
|
|
|
|
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
2026-09-22 17:48:30 +02:00
|
|
|
COPY --from=build /out/bucketeer /bucketeer
|
2026-09-22 13:13:10 +02:00
|
|
|
USER nonroot:nonroot
|
|
|
|
|
EXPOSE 9090
|
2026-09-22 17:48:30 +02:00
|
|
|
ENTRYPOINT ["/bucketeer"]
|