Hadolint
$ hadolint Community Low RiskHadolint (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.
brew install hadolint 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
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Deterministic --format json and sarif output, stdin (-) support, --no-color, and configurable --failure-threshold exit codes.
hadolint --format json Dockerfileoutputs a clean JSON array- Supports stdin
-,--no-color, and--failure-threshold
Pure offline static analyzer with zero filesystem writes, network calls, or credentials.
- Strictly read-only AST and ShellCheck analysis
Prebuilt single binaries for macOS, Linux, and Windows via Homebrew, GitHub Releases, and container images.
- Single static binary via
brew install hadolint
Catches both Dockerfile anti-patterns (DL*) and shell bugs (SC*) in milliseconds before slow Docker builds run.
- Bundles ShellCheck inside Dockerfile
RUNAST parsing
Well-known community open-source tool (hadolint/hadolint) under GPL-3.0.
- Maintained at
hadolint/hadolint
Documented rule wiki (DL* rules) and concise CLI --help.
- Full rule reference in GitHub wiki and README
Security, Auth & Guardrails
No credentials required; optional lint configuration is read from .hadolint.yaml.
100% free and open-source (GPL-3.0) with zero network or API dependencies.
# 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
hadolint --format json Dockerfile
Returns a JSON array of rule IDs (DL*/SC*), line numbers, severities, and messages.
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 jsondiagnostics. - + Integrates ShellCheck (
SC*) directly onRUNblocks alongside Dockerfile (DL*) rules. - + Supports stdin (
-) and.hadolint.yamlpolicy files for CI/agent pipelines.
Caveats & Pitfalls
- ! Does not auto-fix Dockerfiles in place; agents must apply edits from JSON line numbers.
- ! Some
DL3008/DL3018package-pinning rules can be noisy unless tuned in.hadolint.yaml.