env: UPSTREAM_REPO: "Forceu/Gokapi" IMAGE_NAME: "ghcr.io/your-org/gokapi"
env: UPSTREAM_REPO: "Forceu/Gokapi" IMAGE_NAME: "ghcr.io/your-org/gokapi"
env: UPSTREAM_REPO: "Forceu/Gokapi" IMAGE_NAME: "ghcr.io/your-org/gokapi"
FROM golang:1.26.2-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY . .
RUN go generate ./... && \ CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" \ -o /out/gokapi github.com/forceu/gokapi/cmd/gokapi FROM gcr.io/distroless/static:nonroot
COPY --from=build /out/gokapi /gokapi
USER nonroot:nonroot
EXPOSE 53842
ENTRYPOINT ["/gokapi"]
FROM golang:1.26.2-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY . .
RUN go generate ./... && \ CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" \ -o /out/gokapi github.com/forceu/gokapi/cmd/gokapi FROM gcr.io/distroless/static:nonroot
COPY --from=build /out/gokapi /gokapi
USER nonroot:nonroot
EXPOSE 53842
ENTRYPOINT ["/gokapi"]
FROM golang:1.26.2-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY . .
RUN go generate ./... && \ CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" \ -o /out/gokapi github.com/forceu/gokapi/cmd/gokapi FROM gcr.io/distroless/static:nonroot
COPY --from=build /out/gokapi /gokapi
USER nonroot:nonroot
EXPOSE 53842
ENTRYPOINT ["/gokapi"] - Build it yourself. No Docker Hub pulls in production. You must own the registry and the build logs.
- Scan and gate. Every build must ship an SBOM along with a scanner report and a human-readable diff against upstream. Any critical CVEs block the push.
- Harden the base. Stop relying on Alpine or Debian-slim with their monthly CVE churn. Rebase onto a minimal base, distroless by default, so your runtime attack surface shrinks to roughly what your binary actually uses. - Check for a new upstream tag. If nothing changed, it exits.
- Clone upstream at the new tag. This requires zero fork maintenance since the source is unchanged.
- Apply your Dockerfile override. If dockerfiles/Dockerfile.override exists, it replaces the upstream version, allowing you to rebase onto distroless.
- Emit a diff-review artifact. This includes the commit log and full patch between the last built tag and the new one with 90-day retention.
- Build the image once and load it locally.
- Scan with Trivy. It generates a SARIF for the Security tab and a CycloneDX SBOM. CRITICAL or HIGH findings with an available fix block the push.
- Pass or block. If blocked, it auto-files an issue. If passed, it pushes to GHCR and opens a PR against main with the new digest pin. After you review and merge, Flux or ArgoCD sees the updated image-pin.yml and rolls out the exact image CI scanned. - Diff-review artifact: Commits landed, files changed, reviewer name from the merge commit, and timestamp.
- Trivy scanner report: SARIF in the Security tab, timestamped on every build.
- CycloneDX SBOM: Every package and version exactly as shipped. This is what DORA, SOC 2, and ISO 27001 ask for by name.
- Digest-pin PR history: Every production image rollout goes through a reviewed and merged PR with linked scan evidence.
- Documented base-image choice: dockerfile_source: override on every pinned build, reviewable in a PR.
- Blocked builds with auto-filed issues: Idempotent tracking when a CVE hits a version before it reaches production.