Skip to main content

Dockerfile Linter

New

Paste a Dockerfile and get static best-practice checks for unpinned base images, root user, apt cache bloat, and multi-stage build opportunities.

dockerfiledockerlinterbest practicesdevops
Read the guide
Shortcuts:⌘ KSearch
Paste a Dockerfile to lint it.
Findings
    —

Static, offline checks only — this does not build the image or scan actual package vulnerabilities. It flags common anti-patterns (unpinned base images, apt without cleanup, ADD vs COPY, root user, missing .dockerignore consideration, multi-stage opportunities) as a first pass before running a full tool like Hadolint.

Continue with:

Frequently Asked Questions

Is this the same as running Hadolint?

No — this is a lightweight, browser-only subset of the kind of checks a tool like Hadolint performs. It's useful as a quick first pass while editing, but for CI-grade Dockerfile linting with the full shellcheck-backed rule set, a dedicated tool like Hadolint is more thorough.

Why does it flag "FROM node:18" as needing a more specific tag?

A major-version-only tag like "node:18" will silently pick up new minor/patch releases (and different underlying OS package versions) on every fresh pull, which can make a passing build fail later with no code changes on your end. Pinning to something like "node:18.19-bookworm-slim" or a specific digest makes builds reproducible.

Why is "apt-get update" in its own RUN flagged?

Docker caches each RUN instruction as its own layer. If "apt-get update" is cached from an old layer but "apt-get install" runs later (in a different or rebuilt layer), you can install packages against a stale, no-longer-available package index. Combining them into one RUN with && avoids this class of bug entirely.

What does it mean by a "multi-stage build opportunity"?

If a Dockerfile has only one FROM stage but clearly installs build tooling (like a compiler, npm/pip, or a build command), that tooling typically isn't needed at runtime. A multi-stage build lets you compile in one stage and copy only the final artifact into a slim runtime stage, often shrinking the final image substantially.

Does this tool actually build or run my Dockerfile?

No — it only performs static text/line pattern analysis in your browser. It doesn't invoke Docker, doesn't validate that the Dockerfile actually builds successfully, and doesn't scan the resulting image for vulnerabilities.

Related Tools