Repository navigation
Description
Problem
No linter checks the two Dockerfiles (git grep -i hadolint finds only archived notes). hadolint finds the common Dockerfile mistakes.
Change
- Add the hadolint-py hook (hadolint packaged on PyPI, 2.15.1.3) to .pre-commit-config.yaml for Dockerfile and .devcontainer/Dockerfile.
- Add
.hadolint.yamlthat ignores DL3008 only, with the reason: apt floats with sid by the owner decision of 2026-11-19. - Fix the other findings in the two Dockerfiles. fix(devcontainer): build the devcontainer image FROM devtools #6414 and build(docker): build the runner image FROM devtools with no tool install #4361 make them small.
- Do not use the upstream
hadolinthook. It islanguage: systemand fails on a stock runner. - The devtools repository can add the same hook as its own change.
Renovate. The built-in pre-commit manager bumps the hook rev.
Risk. The DL3008 ignore records an owner decision for a new linter. It lowers no existing threshold. Before you pin the hook, check that a hadolint-py wheel exists for the runner platform.
Proof
uv run pre-commit run hadolint-py --all-filespasses in the devcontainer.- Static Analysis runs it on a stock runner with no install step.
Alternatives check of 2026-11-19: not-applicable.
Class: ci, no search.
Tool: none found.
Proposed design
Problem statement
No linter checks Dockerfile and .devcontainer/Dockerfile, so the common Dockerfile mistakes that hadolint reports go unreported. Static Analysis runs no pre-commit hook, so a hook alone would not gate a merge. The change adds the hadolint pre-commit hook, makes it a devops ci row that Static Analysis runs, ignores DL3008 only for the apt float that the owner decision of 2026-11-19 keeps, and fixes the other findings in the two Dockerfiles.
Acceptance criteria
Requirement: hadolint hook covers both Dockerfiles
The pre-commit configuration SHALL add the hadolint hook of shenxianpeng/hadolint-pre-commit at rev v2.15.1.3, so the hook runs on Dockerfile and .devcontainer/Dockerfile.
Scenario: Both Dockerfiles match the hook
- WHEN
uv run pre-commit run hadolint --files Dockerfile .devcontainer/Dockerfile --verboseruns - THEN The command exits 0 and prints
Passed, not(no files to check).
Requirement: The two Dockerfiles pass hadolint
Both Dockerfiles SHALL pass the hadolint hook with every finding other than DL3008 fixed.
Scenario: The hook finds no other rule
- WHEN
uv run pre-commit run hadolint --all-filesruns - THEN The command exits 0 and prints no finding.
Requirement: Only DL3008 is ignored
.hadolint.yaml SHALL ignore DL3008 only, with the reason that the apt packages float with the Debian security updates that the final stages take, by the owner decision of 2026-11-19 that devops-cli is not a package manager.
Scenario: A rule other than DL3008 still fails
- WHEN
uv run pre-commit run hadolint --all-filesruns on the two Dockerfiles, anduv run pre-commit run hadolint --files .data/agent/scratch/Dockerfileruns on a scratch file that holdsFROM debian:trixie-slimandRUN cd /tmp && true - THEN The first command exits 0 and the second exits 1 with a finding that names DL3003.
Requirement: hadolint is a devops ci row
devops ci SHALL hold a hadolint row whose command runs the hadolint pre-commit hook over all files.
Scenario: The row is the hook
- WHEN
uv run pytest tests/commands/test_ci_row_commands.py -k hadolintruns - THEN The test passes and asserts the row's command is
uv run pre-commit run hadolint --all-files.
Requirement: The required gate runs the row
Static Analysis SHALL run the hadolint row through devops ci.
Scenario: The row passes in the gate
- WHEN
uv run devops ci --check --only hadolintruns - THEN The row passes and its output names
hadolint.
Requirement: The runner image table names the row
RUNNER_TOOLS SHALL name ci:hadolint in the needed_by of the pre-commit tool, so the runner image check holds the hook.
Scenario: A held row program names the row
- WHEN
uv run pytest tests/roadmap/test_roadmap_runner_tools.py -k test_a_tool_that_a_row_starts_names_that_row_as_a_reasonruns - THEN The test passes.
Existing Tool Considered
The open shenxianpeng/hadolint-pre-commit project at rev v2.15.1.3 (PyPI hadolint-py 2.15.1.3) covers the need: its hadolint hook pip-installs the official hadolint binary as a platform wheel, so a stock runner needs no install step (https://github.com/shenxianpeng/hadolint-pre-commit, fetched 2026-11-22). It lacks a universal, offline wheel: setuptools-download fetches the hadolint 2.15.1 binary from its GitHub release, and the release publishes a wheel only for Linux x86_64/arm64, macOS x86_64/arm64 and Windows x86_64, so the first run needs PyPI and, on a platform without a wheel, github.com. The upstream hadolint/hadolint hook installs no binary and is language: system, so a stock runner fails with Executable hadolint not found.
Key questions
- Does the required
Static Analysisjob run the pre-commit hooks?: No.Static Analysisrunsuv run devops ci --check --no-cache --skip test,outdated,actionlint, andCHECK_ROW_NAMESholds no row that runs pre-commit. A hook alone would not gate a merge. [sources: .github/workflows/ci.yml:105, src/devops_cli/commands/ci.py:136, docs/SDLC.md:205, docs/adr/0004-ci-is-the-authoritative-gate.md:11] - How does the hadolint hook reach the required
Static Analysischeck?: Add ahadolintrow to thedevops ciregistry that runsuv run pre-commit run hadolint --all-files.Static Analysisruns every row ofdevops ciexcept the three it skips, so the lint gates merges with no separate workflow step, anduv run devops ciruns it by hand too. (best practice) [sources: .github/workflows/ci.yml:105, docs/SDLC.md:205, src/devops_cli/commands/ci.py:136, src/devops_cli/commands/ci.py:1001, tests/commands/test_ci_row_commands.py:96]- Chosen: Add a hadolint row to devops ci.
Static Analysisruns every row ofdevops ci, so the lint becomes part of the required check and of the local full gate. - Rejected: Add a step to the Static Analysis job only.
uv run devops ciby hand would not run the lint, so the local full gate and CI would differ. - Rejected: Keep only the pre-commit hook.
Static Analysisruns no pre-commit hook, so a Dockerfile finding could merge.
- Chosen: Add a hadolint row to devops ci.
- Which hadolint integration does the repository use?: Use the
hadolinthook ofshenxianpeng/hadolint-pre-commitat revv2.15.1.3, which pip-installshadolint-pyand its platform wheel (https://github.com/shenxianpeng/hadolint-pre-commit, fetched 2026-11-22). The upstreamhadolint/hadolinthook installs no binary, so a stock runner fails withExecutable hadolint not found. A Docker-image hook needs a container engine on the runner and pulls an image on each run. (best practice) [sources: https://github.com/shenxianpeng/hadolint-pre-commit, .pre-commit-config.yaml, .github/renovate/base.json:54]- Chosen: shenxianpeng/hadolint-pre-commit v2.15.1.3. It installs the binary in the hook environment, so a stock runner needs no install step, and Renovate's pre-commit manager bumps the rev.
- Rejected: hadolint/hadolint official hook. It is
language: systemand installs no binary, so it fails on a stock runner withExecutable hadolint not found. - Rejected: Docker-image hook. It needs a container engine on the runner and pulls an image on each run.
- What does
.hadolint.yamlignore, and why?: Ignore DL3008 only. The reason beside it: the apt packages float because the final stages take the Debian security updates withapt-get upgrade, and devops-cli is not a package manager (owner decision of 2026-11-19), so the Dockerfile pins no apt version. The rootDockerfileinstallsgitandca-certificateswithout a version in theservice-depsstage, and theserviceandmcp-serverstages runapt-get upgradewith no cache. The devcontainer image takes its apt packages from the devtools image, which is Debian sid and upgrades in its own build. (best practice) [sources: openspec/changes/archive/2026-11-20-4361-runner-from-devtools/proposal.md:4]- Chosen: Ignore DL3008 in .hadolint.yaml with the reason. One config line records the deliberate float and keeps the reason beside it; the final stages take the security updates, and the owner decision of 2026-11-19 keeps devops-cli out of package management.
- Rejected: Pin every apt package version. A pin freezes the package that the final stages'
apt-get upgradeupdates, and it copies a Debian version into the Dockerfile, which the owner decision of 2026-11-19 forbids. - Rejected: An inline
# hadolint ignore=DL3008on each apt line. It repeats the reason at each apt-get, and a new apt line can miss it.
- Does a
hadolint-pywheel exist for the runner platform?: Yes. Thehadolint-pyrelease publishes a platform wheel, and the hook lists Linux x86_64, Linux arm64, macOS x86_64/arm64 and Windows x86_64 as supported (https://github.com/shenxianpeng/hadolint-pre-commit, fetched 2026-11-22). The requiredStatic Analysisjob runs onubuntu-26.04, which is Linux x86_64, so a matching wheel exists.setuptools-downloadfetches the official hadolint 2.15.1 binary from its GitHub release for a platform that has no wheel. [sources: https://github.com/shenxianpeng/hadolint-pre-commit, .github/workflows/ci.yml:50] - Does Renovate bump the hook rev?: Yes. The
pre-commitmanager is enabled in.github/renovate/base.json. Non-major hook updates are grouped aspre-commit hooks, so a newhadolint-pre-commitrelease arrives as a dependency update. [sources: .github/renovate/base.json:54, .github/renovate/base.json:81] - Must
RUNNER_TOOLSname the new row?: Yes.test_a_tool_that_a_row_starts_names_that_row_as_a_reasonfails when a held program starts a row that does not name the row.pre-commitis a held checkout tool, so itsneeded_bymust addci:hadolint. [sources: tests/roadmap/test_roadmap_runner_tools.py:199, src/devops_cli/roadmap/runner_tools.py:148]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 19, 2026
Both add pre-commit hooks, but #428 adds AST and structural validators while the candidate adds a Dockerfile linter.devops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 22, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
feat(docker): lint the Dockerfiles with hadolint in pre-commit
devops-cli-service commentedon Nov 24, 2026
Released in v0.207.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.207.0
devops-cli-service commentedon Nov 24, 2026
Live since 2026-11-24 13:45 UTC