Back to Tools

Dockerfile Linter

Analyze your Dockerfile for syntax issues and best practices.

Input Data

A quick review pass for your Dockerfile

Before you build an image, it helps to catch the habits that cause slow builds and surprise upgrades. This linter reads a Dockerfile line by line and reports a small set of well-known problems, each with the line number so you can jump straight to it. It is meant as a fast sanity check, not a replacement for a full tool such as hadolint.

Running a check

  1. Paste your Dockerfile into the Input Data box. Press Sample to load an intentionally flawed example based on a Node image.
  2. Click Process / Generate.
  3. Read the yellow list headed Lint Warnings/Errors. The summary row shows how many suggestions were found, or that no issues were found.
  4. Use Copy or Download if you want to keep the report, then fix the file and run the check again.

The rules it applies

  • Latest tag: any FROM line containing :latest is flagged, because the base image can change between builds.
  • Instruction before FROM: reported once, on the first offending line.
  • MAINTAINER: flagged as deprecated, with a suggestion to use LABEL maintainer instead.
  • ADD for local files: flagged unless the line mentions http or .tar, since COPY is clearer for plain files.
  • Many RUN commands: a notice appears when there are more than two RUN instructions, suggesting they be chained with && to reduce layers.

Blank lines and comments are ignored, and instruction names are matched regardless of case.

Practical uses

  • Reviewing a Dockerfile someone sent you before adding it to a repository.
  • Teaching juniors why pinned base image versions matter.
  • Tidying an old project that still uses MAINTAINER.
  • Trimming layer count before pushing an image to a registry.

Limits worth knowing

The checks are basic string matching. A FROM line with no tag at all is not flagged, and there is no test for running as root, missing HEALTHCHECK, unpinned apt packages or multi-stage structure. An ARG placed before FROM is legal in Docker but will be reported here. Continuation lines that end with a backslash are read as separate lines, and a RUN split across several lines still counts once. A clean result therefore means only that these specific patterns were not found. The analysis runs as JavaScript in your browser page.

Related Tools




Frequently Asked Questions

What issues does the Dockerfile Linter look for?
It checks for :latest in FROM lines, instructions that appear before FROM, the deprecated MAINTAINER instruction, ADD used with local paths instead of COPY, and more than two RUN commands. Each finding shows a line number where applicable.
Why is my ARG before FROM flagged?
The linter treats any instruction that appears before the first FROM as a problem. Docker does allow ARG there to parameterise the base image, so you can safely ignore that warning if the ARG is intentional.
Does a clean result mean my Dockerfile is production-ready?
No. The tool only tests a handful of patterns. It does not check for running as root, missing health checks, package version pinning, cache-busting mistakes or multi-stage design, so continue to review those points yourself or with a fuller linter.
Why does it say to avoid ADD?
ADD can also fetch remote URLs and unpack archives, which makes its behaviour less obvious. For copying ordinary files, COPY does exactly one thing. The linter allows ADD when the line contains http or .tar, since those are the cases ADD is meant for.
Can I download the lint report?
Yes. After the check runs, the Copy button places the report text on your clipboard and Download saves it as result.txt. Note that the report only lists findings, not a corrected Dockerfile.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.