Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

linting: run-pre-commit can't run hadolint — bundle the static binary, drop docker-cli

Closed
#302 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, go
Domain
ci-cd, tooling

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 hadolint static binary in linting/container.go. It's a static musl binary, runs natively on Alpine. Pin the version. wget is 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-cli from the apk add list — dead weight once hadolint-docker is 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.yaml to use the system hadolint binary so the module dog-foods what it ships. Note: the upstream hadolint/hadolint hook id is itself language: docker_image — to use the on-PATH binary, wire a repo: local, language: system, entry: hadolint hook. 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.Z and show the repo: local hook snippet consumers should use.

Downstream (stage-time, after a new linting release)

  • Bump the run-pre-commit ref in the consuming workflow.
  • Remove --skip-hooks hadolint-docker and switch the hook to system hadolint.
  • 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stuttgart-things/dagger

All issues in stuttgart-things/dagger

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.