Skip to main content

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

Result
SeverityCount
No data yet

Issues

Result
LineSeverityRuleMessageExplanation
No data yet

Formatted Dockerfile

Formatted Dockerfile
 
Was this helpful?

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 :latest tag (DL3007), which make builds non-reproducible.
  • Security — no USER instruction so the container runs as root (DL3002), possible secrets hardcoded in ENV (DL3060), and sudo inside RUN (DL3004).
  • Image size & layers — multiple consecutive RUN instructions 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't FROM (DL3001), cd inside RUN instead of WORKDIR (DL3003), invalid EXPOSE ports (DL3011), unpinned pip packages (DL3013), ADD where COPY belongs (DL3020), shell-form CMD/ENTRYPOINT (DL3025), a missing HEALTHCHECK (DL3048), and the deprecated MAINTAINER instruction (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

  1. Paste your Dockerfile into the input, or click Try an example to load a deliberately messy one.
  2. Read the Summary table for a quick error/warning/info count.
  3. Work through the Issues table — the rule codes match Hadolint, so you can look up any rule you don't recognize.
  4. Copy the Formatted Dockerfile, which combines consecutive RUN layers with && \ and sorts apt-get, pip, and apk package 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.

dockerdockerfilelinterhadolintdevopsbest-practicesformatter

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.