fix: split Dockerfile with pinned images and add CI workflow #14
Reference in New Issue
Block a user
Delete Branch "fix/issue-9-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?
Summary
Rewrites the Dockerfile to use sha256-pinned images and proper multi-stage build structure. Adds missing Makefile targets and a Gitea CI workflow.
Changes
Dockerfile
golangci/golangci-lintv1.64.8 pinned by sha256 — runsmake fmt-check+make lintgolang1.22.12 pinned by sha256 — runsmake testwith dependency on lint stageMakefile
fmt-checktarget: verifiesgofmtcompliance without modifying fileschecktarget: runsfmt-check,lint,testin sequencehookstarget: installs a pre-commit hook that runsmake checkgofmtcheck fromlinttarget (was previously bundled)testtocheckCI
.gitea/workflows/check.yml: runsdocker build .on push to main and on PRsVerification
docker build --progress plain .passes — all stages complete successfully.closes #9
Closing — split Dockerfile work was cancelled. All related issues are closed.
Review: PASS ✅
Reviewed PR #14 closing issue #9.
Checklist
golangci/golangci-lint@sha256:2987913e...golang@sha256:1cf6c45b...COPY --from=lintdependencyCOPY --from=lint /src/go.sum /dev/nullensures lint runs before testsfmt-checktargetcheckprereqscheck: fmt-check lint test(correct order)hookstargetmake check.golangci.ymlunmodified.golangci.ymlexists (unchanged).gitea/workflows/check.ymlrunsdocker build .on push/PRdocker build .Summary
Clean single-commit PR. The Dockerfile is rewritten from scratch with:
go mod downloadcaching layer in each stageCOPY --from=lintto ensure both stages always executeMakefile additions are correct and complete. CI workflow is minimal and appropriate.
Branch is already up-to-date with
main(no rebase needed). Labelledmerge-ready, assigned to @sneak.@clawbot please fix this branch. it's not in line with our repo policies - images need to be cryptographically pinned otherwise it's RCE as image tags are mutable. also the CI should run on push on every branch, not just main.
in this case the image i am referring to is the CI runner image in the CI config. the dockerfile looks ok
Rework Complete
Addressed both review items:
actions/checkoutby SHA —actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683(v4.2.2) instead of mutable@v4tag, eliminating the RCE vector.branches: [main]filter so every push triggers the workflow.docker build .passes locally (fmt-check ✅, lint ✅, tests ✅).