Split Dockerfile: pre-built golangci-lint stage for faster CI #26
No reviewers
Labels
No Label
bot
merge-ready
needs-review
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/gohttpserver#26
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/issue-22-dockerfile-split"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #22
Changes
Makefile
fmt-checktarget: checks gofmt formatting without modifying fileshookstarget: installs pre-commit git hookchecktarget: now runsfmt-check lint testlinttarget (now infmt-check).PHONYdeclarations for all phony targetstoolstarget to usego installDockerfile
golangci/golangci-lint:v1.64.8(sha256-pinned)make fmt-checkandmake lintfor fast feedbackgolang:1.24-bookworm(sha256-pinned, matches go.mod 1.24.0)COPY --from=lintforces BuildKit to actually run the lint stagemake testthenmake builddebian:bookworm-slim(sha256-pinned)CI
.gitea/workflows/check.yml: runsdocker build .on push to main and PRsImage Versions
Verification
docker build .passes locally — all stages (lint, test, build) execute correctly.Review: PASS ✅
All requirements from issue #22 verified:
COPY --from=lintBuildKit dependency exists.golangci.ymlnot modifiedfmt-checkMakefile target addedhooksMakefile target added.gitea/workflows/check.yml) addedchecktarget updated tofmt-check lint testdocker build .passesDetails
Dockerfile — Clean three-stage split:
golangci/golangci-lint:v1.64.8(sha256-pinned, dated 2025-03-17). Runsfmt-checkandlintfor fast feedback.golang:1.24-bookworm(sha256-pinned).COPY --from=lint /src/go.sum /dev/nullcorrectly forces BuildKit to execute the lint stage. Runstestthenbuild.debian:bookworm-slim(sha256-pinned). Minimal — just the binary, CA certs, and proper ENV syntax.Makefile —
fmt-checkcorrectly usesgofmt -lwithout modification.lintno longer duplicates the gofmt check.hooksinstalls a pre-commit hook..PHONYdeclarations added.toolsmodernized togo install.CI — Simple
docker build .on push to main and PRs. Correct.Good cleanup: removed vendoring/source tarball, updated ENV syntax, removed stale
go getcommands.docker build .verified locally — all stages pass (lint, test, build).@clawbot REWORK. checks should run on all branches, not just main, and the
actions/checkoutimage is not pinned by hash like is required.Rework complete — CI workflow fixes applied:
actions/checkoutby commit SHA (11bd71901bbe5b1630ceea73d27597364c9af683, v4.2.2) — tags are mutable and an RCE vectormaindocker build .passes locally ✅Only
.gitea/workflows/check.ymlwas modified.