linting: run-pre-commit can't run hadolint — bundle the static binary, drop docker-cli
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with linting/container.go and the existing linting/README.md, then inspect .pre-commit-config.yaml and tests/linting/. Run the pre-commit configuration against valid and invalid Dockerfile fixtures to verify the system hadolint hook works in the container. Done means the pinned binary is bundled, docker-cli is removed, documentation matches the shipped hook, and the fixture path is exercised.
Written by the indexing model from the issue text.
Description
Summary
The linting module's run-pre-commit function can't actually run a hadolint hook. container.go builds an alpine:3.21 image and apk adds docker-cli, but there's no Docker daemon inside a Dagger container and no hadolint binary is installed at all. Meanwhile linting/README.md already documents the intended direction ("use hadolint instead of hadolint-docker") and ships a --skip-hooks hadolint-docker workaround — so the README promises a hook the image can't satisfy.
Decision: finish the system-hadolint route (bundle the static binary), not a separate Docker-based lint function.
To-do (linting module)
- Install the
hadolintstatic binary inlinting/container.go. It's a static musl binary, runs natively on Alpine. Pin the version.wgetis already in the image, so no extra apk dep:ctr = ctr.WithExec([]string{"sh", "-c", "wget -qO /usr/local/bin/hadolint " + "https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 " + "&& chmod +x /usr/local/bin/hadolint"}) - Drop
docker-clifrom theapk addlist — dead weight oncehadolint-dockeris gone; nothing else in the module shells out to docker. It's what created the false impression Docker linting worked. - Update the repo's
.pre-commit-config.yamlto use the systemhadolintbinary so the module dog-foods what it ships. Note: the upstreamhadolint/hadolinthook id is itselflanguage: docker_image— to use the on-PATH binary, wire arepo: local,language: system,entry: hadolinthook. Confirm exact hook wiring against a real pre-commit run before shipping (the README's "use hadolint" phrasing glosses over this). - Add a Dockerfile fixture under
tests/linting/(valid + invalid) so CI exercises the hadolint path. - README touch-up: state the image bundles
hadolint vX.Y.Zand show therepo: localhook snippet consumers should use.
Downstream (stage-time, after a new linting release)
- Bump the
run-pre-commitref in the consuming workflow. - Remove
--skip-hooks hadolint-dockerand switch the hook to systemhadolint. - Close the hadolint follow-up on stuttgart-things/stage-time#34.
Caveat
The one unverified piece is the exact repo: local / language: system hook config — upstream hadolint hook ids are both docker-based, so a local system hook is the reliable wiring. Confirm against a real pre-commit run in the sandbox before shipping.
- Dominant language
- Go
- Stars
- 3
- Forks
- 0
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 37
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stuttgart-things/dagger
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stuttgart-things/dagger#311 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stuttgart-things/dagger#400 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
stuttgart-things/dagger#386 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 48/100
stuttgart-things/dagger#385 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stuttgart-things/dagger#262 · 3 comments ·
Maintainers usually reply within 1 day
All issues in stuttgart-things/dagger
Similar issues
-
duplication
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openvibely/openvibely#1443 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
keyxmakerx/Chronicle#1179 ·
Maintainers usually reply within 1 day
-
raised-by:worker
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
medici-finance/assay#2486 ·
Maintainers usually reply within 1 day
-
area/testing kind/bug triage/needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cozystack/cozystack#4841 · 1 reaction ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openimsdk/openim-sdk-core#1127 ·