Files
kryptkeeper/Dockerfile.certmanager
T
bpmforge 71a7987d26 Fix source builds on x86_64; README leads with CA and lifecycle management
Snapshot of development commit 5c3a432d.

- Dockerfiles no longer default TARGETARCH, so building from source on an
  x86_64 host produces an x86_64 binary (it produced an ARM binary that
  failed with "exec format error"). Released images were not affected.
- getting-started.md matches the current Compose setup and API.
- scripts/day-one-estate.sh works against a current hub, and the day-one
  estate run on a new VM is recorded in docs/release/DAY_ONE_RUN_v1.1.md.
- The README describes both halves: a CA that can replace AD CS, and
  lifecycle management for certificates from any CA.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-28 15:33:26 -04:00

42 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:1.7
# Container image for kryptkeeper-certmanager (cmd/kryptkeeper-certmanager):
# a cert-manager external issuer controller that delegates certificate
# signing to the Kryptkeeper Hub. Runs in-cluster only (NewInClusterClient);
# it opens no listening port, so there is no HEALTHCHECK here -- liveness is
# a Kubernetes-level concern (process exit), not an HTTP probe.
#
# Build:
# docker buildx build --platform linux/amd64,linux/arm64 \
# -f Dockerfile.certmanager -t kryptkeeper-certmanager:local .
FROM --platform=$BUILDPLATFORM golang:1.27-alpine AS builder
ARG TARGETOS=linux
# Empty unless BuildKit or --build-arg sets it; the build then targets the
# builder's own architecture (a hard-coded default built arm64 binaries on x86_64).
ARG TARGETARCH
# W20-02: stamps this binary's version/commit/date vars.
ARG VERSION=dev
ARG COMMIT=unknown
ARG DATE=unknown
WORKDIR /src
COPY . /src
RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS="${TARGETOS}" GOARCH="${TARGETARCH:-$(go env GOARCH)}" \
go build -trimpath -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" \
-o /out/kryptkeeper-certmanager ./cmd/kryptkeeper-certmanager
FROM gcr.io/distroless/static-debian12:nonroot
LABEL org.opencontainers.image.title="kryptkeeper-certmanager"
LABEL org.opencontainers.image.description="Kryptkeeper cert-manager external issuer: delegates CertificateRequest signing to the Hub"
LABEL org.opencontainers.image.source="https://github.com/${GITHUB_REPOSITORY:-unknown}"
COPY --from=builder /out/kryptkeeper-certmanager /kryptkeeper-certmanager
USER nonroot:nonroot
ENTRYPOINT ["/kryptkeeper-certmanager"]