Split Dockerfile: pre-built golangci-lint stage for faster CI #45
Ссылка в новой задаче
Block a user
Удалить ветку «split-dockerfile-lint-stage»
Удаление ветки необратимо. Несмотря на то, что удаленная ветка может просуществовать некоторое время перед тем, как она будет окончательно удалена, это действие НЕВОЗМОЖНО отменить в большинстве случаев. Продолжить?
Closes #39
Splits the Dockerfile into a dedicated lint stage using the
golangci/golangci-lintimage directly, rather than copying the binary into the builder stage.Changes
Dockerfile
AS lint): Uses the pre-builtgolangci/golangci-lintimage (pinned by sha256) to runmake fmt-checkandmake lint. This is a self-contained stage with its owngo mod downloadand source copy.AS builder): Runs onlymake testand the final binary build. No longer needs golangci-lint installed.COPY --from=lint /src/go.sum /dev/nullforces BuildKit to always execute the lint stage (without this, unused stages are silently skipped).mfer/mf.pb.goto prevent make from trying to regenerate via protoc.With BuildKit, the lint and builder stages run in parallel after their shared
go mod downloadlayers complete, so lint/formatting failures surface much faster without blocking on test execution.Makefile
lintto thechecktarget prereqs:check: test lint fmt-check(wascheck: test fmt-check), matching the REPO_POLICIES requirement.