- ci: reject a manual dispatch with tag "latest"; concurrency group per tag - Dockerfile: declare GIT_COMMIT after the module download layer - Makefile: docker-build targets linux/amd64 by default - patch.go: no shared package-level pointers; main.go: no init() - tests: assert that merge replaces managed listener content - docs: flows.md startup section matches main.go; review saved to docs/reviews Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
890 B
Docker
28 lines
890 B
Docker
FROM golang:1.25 AS builder
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
|
|
WORKDIR /workspace
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# .dockerignore filters the context down to Go sources and module files.
|
|
COPY . .
|
|
|
|
# The build context has no .git, so Go's automatic VCS stamp is absent here;
|
|
# the commit comes in through GIT_COMMIT instead. Declared this late so a new
|
|
# commit does not invalidate the module-download layer.
|
|
ARG GIT_COMMIT=unknown
|
|
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build \
|
|
-trimpath \
|
|
-ldflags "-s -w -X gitea.home.hrajfrisbee.cz/kacerr/gatewayapi-certificates-operator/internal/version.Commit=${GIT_COMMIT}" \
|
|
-o manager .
|
|
|
|
FROM gcr.io/distroless/static:nonroot
|
|
ARG GIT_COMMIT=unknown
|
|
LABEL org.opencontainers.image.revision="${GIT_COMMIT}"
|
|
WORKDIR /
|
|
COPY --from=builder /workspace/manager .
|
|
USER 65532:65532
|
|
ENTRYPOINT ["/manager"]
|