Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Hadolint

$ hadolint Community Low Risk
Hadolint · Cloud & Infra · GPL-3.0 · macos / linux / windows

Hadolint (hadolint) parses Dockerfiles into an AST and lints best practices alongside inline ShellCheck validation on RUN instructions. It runs completely offline and read-only, emitting structured diagnostics via --format json, sarif, checkstyle, or codeclimate.

FCRS-1.0 Score
90 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install hadolint
CLI vs MCP Decision CLI Only

hadolint --format json is a zero-side-effect local static analyzer; running it directly is faster and cleaner than any MCP wrapper.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 24 / 25

Deterministic --format json and sarif output, stdin (-) support, --no-color, and configurable --failure-threshold exit codes.

  • hadolint --format json Dockerfile outputs a clean JSON array
  • Supports stdin -, --no-color, and --failure-threshold
Trust & Safety 25 / 25

Pure offline static analyzer with zero filesystem writes, network calls, or credentials.

  • Strictly read-only AST and ShellCheck analysis
Setup & Portability 14 / 15

Prebuilt single binaries for macOS, Linux, and Windows via Homebrew, GitHub Releases, and container images.

  • Single static binary via brew install hadolint
Utility & Efficiency 12 / 15

Catches both Dockerfile anti-patterns (DL*) and shell bugs (SC*) in milliseconds before slow Docker builds run.

  • Bundles ShellCheck inside Dockerfile RUN AST parsing
Maintenance & Lineage 7 / 10

Well-known community open-source tool (hadolint/hadolint) under GPL-3.0.

  • Maintained at hadolint/hadolint
Docs & Verifiability 8 / 10

Documented rule wiki (DL* rules) and concise CLI --help.

  • Full rule reference in GitHub wiki and README

Security, Auth & Guardrails

Auth Modes
No Auth Config File
Credential Storage

No credentials required; optional lint configuration is read from .hadolint.yaml.

Side Effects
Read-Only
Cost & Quotas

100% free and open-source (GPL-3.0) with zero network or API dependencies.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Hadolint Agent Rules
- Always pass `--format json` when running `hadolint` so rule IDs and line numbers parse cleanly.
- Use `--ignore DL3008` or `.hadolint.yaml` only when intentionally skipping specific rules—never silence all warnings blindly.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint a Dockerfile and emit JSON findings
hadolint --format json Dockerfile

Returns a JSON array of rule IDs (DL*/SC*), line numbers, severities, and messages.

Lint a Dockerfile from stdin with strict warning threshold
hadolint --format json --failure-threshold warning - < Dockerfile

Validates Dockerfile content from stdin and exits non-zero only on warning or higher severity.

Strengths for Agents

  • + Purely read-only and offline with deterministic --format json diagnostics.
  • + Integrates ShellCheck (SC*) directly on RUN blocks alongside Dockerfile (DL*) rules.
  • + Supports stdin (-) and .hadolint.yaml policy files for CI/agent pipelines.

Caveats & Pitfalls

  • ! Does not auto-fix Dockerfiles in place; agents must apply edits from JSON line numbers.
  • ! Some DL3008/DL3018 package-pinning rules can be noisy unless tuned in .hadolint.yaml.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI