Dockerfile Linter
Lint a Dockerfile against 18 Hadolint-style best-practice rules (unpinned base images, running as root, secrets in ENV, layer bloat, and more) and auto-format it — combining RUN layers and sorting package lists. Runs entirely in your browser.
Input
Output
Summary
| Severity | Count |
|---|---|
| No data yet | |
Issues
| Line | Severity | Rule | Message | Explanation |
|---|---|---|---|---|
| No data yet | ||||
Formatted Dockerfile
Guides
The Dockerfile Linter checks your Dockerfile against 18 Hadolint-style best-practice rules and, in the same pass, reformats it into a cleaner, more reproducible shape. Paste your Dockerfile and you instantly get a severity summary, a line-by-line list of issues, and an auto-formatted version — all computed in your browser as you type.
What it checks
The linter flags the mistakes that most often bloat images, break reproducibility, or weaken security:
- Base images — unpinned images (
DL3006) and the:latesttag (DL3007), which make builds non-reproducible. - Security — no
USERinstruction so the container runs as root (DL3002), possible secrets hardcoded inENV(DL3060), andsudoinsideRUN(DL3004). - Image size & layers — multiple consecutive
RUNinstructions that should be combined (DL3059), apt-get lists left behind (DL3009), and missing--no-install-recommends(DL3015). - Correctness & style — unknown instructions (
DL3000), a first instruction that isn'tFROM(DL3001),cdinsideRUNinstead ofWORKDIR(DL3003), invalidEXPOSEports (DL3011), unpinnedpippackages (DL3013),ADDwhereCOPYbelongs (DL3020), shell-formCMD/ENTRYPOINT(DL3025), a missingHEALTHCHECK(DL3048), and the deprecatedMAINTAINERinstruction (DL4000).
Each issue shows its line number, severity (error, warning, or info), the Hadolint-compatible rule code, a short message, and an explanation of how to fix it.
How to use it
- Paste your Dockerfile into the input, or click Try an example to load a deliberately messy one.
- Read the Summary table for a quick error/warning/info count.
- Work through the Issues table — the rule codes match Hadolint, so you can look up any rule you don't recognize.
- Copy the Formatted Dockerfile, which combines consecutive
RUNlayers with&& \and sortsapt-get,pip, andapkpackage lists alphabetically.
Is this the same as Hadolint?
It uses the same rule codes (DLxxxx) and covers the most impactful subset of Hadolint's checks, but it is an independent implementation — not a wrapper around the Hadolint binary — so it will catch fewer edge cases than the full tool. It's ideal for a quick review without installing anything.
Does it modify my Dockerfile?
No. The formatted output is a suggestion you can copy or download; your input is never changed automatically. The formatter is conservative — it re-lays-out instructions but does not add or remove functionality.
Why sort package lists?
Alphabetically sorted apt-get install/pip install/apk add lists are easier to scan, review in diffs, and de-duplicate — a common Dockerfile hygiene convention.
Privacy
This tool runs entirely in your browser. Your Dockerfile is never uploaded, logged, or sent to any server — all linting and formatting happens locally on your device.