# Lint-only image: used by script/lint. golangci-lint is never run on # the host — the repo is COPYed into the build context and the linter # runs as a build step, so a successful build IS a clean lint. This # also works where the docker daemon is remote and bind mounts are # impossible. # # `golangci-lint config verify` is deliberately NOT run here: it # fetches its JSON schema over a live, unpinned HTTPS call, which would # make linting network-dependent and defeat hash-pinning. The cost of # that: unknown top-level keys in .golangci.yml are silently ignored, # so a mistyped or wrong-schema key lints clean while applying nothing. # # golangci/golangci-lint:v2.12.2 (Debian-based), 2026-08-10 FROM golangci/golangci-lint:v2.12.2@sha256:5cceeef04e53efe1470638d4b4b4f5ceefd574955ab3941b2d9a68a8c9ad5240 AS deps WORKDIR /src # Dependencies first, so this stage stays cached across lint runs. COPY go.mod go.sum ./ RUN go mod download # Everything below is invalidated on every run by the # --no-cache-filter=lint that script/lint passes: caching is explicitly # waived for linting, and a cached build lints nothing. FROM deps AS lint COPY . . RUN golangci-lint run --config .golangci.yml ./...