Dockerfile Linter

Paste a Dockerfile and get quick feedback on common mistakes.

What it checks

The linter flags images using the latest tag or no tag, ADD where COPY is usually better, apt-get install without --no-install-recommends, a missing USER (the container runs as root) and a missing WORKDIR.

Warnings and info

Results are marked WARN or INFO with the line number where it applies. Treat them as guidance rather than hard rules.

How to use it

  1. Paste your Dockerfile into the box.
  2. Press Lint.
  3. Review the results and fix what applies to you.

Example

This Dockerfile:

FROM node:latest
ADD . /app
RUN apt-get install curl
CMD npm start

produces warnings for the latest tag and for running as root, and info notes about ADD, install flags and WORKDIR.

Common use cases

The exact rules and how they match

The linter reads your file line by line, skips blank lines and comments, and applies simple pattern checks. The results below are everything it can report:

Instruction names are matched case-insensitively for most rules. If every rule passes the output is a green tick and the words No issues found.

Cases it will miss

Because it uses line patterns rather than a real Dockerfile parser, it has blind spots you should know about before trusting a clean result:

It also does not check layer ordering, pinned package versions, HEALTHCHECK, secrets in ENV or ARG, or shell form versus exec form of CMD. For a deeper check use hadolint, which implements many more rules.

Fixing the common findings

A tag warning is fixed by pinning, for example FROM node:20-alpine. Pin to a minor version if you want patches, or a digest if you need exact reproducibility. For the root-user warning, create a user near the end: RUN adduser -D app then USER app, and make sure files the app writes are owned by it. Put the install flag in as apt-get install -y --no-install-recommends curl, and clean up with rm -rf /var/lib/apt/lists/* in the same RUN so the cache never lands in a layer.

If the linter flags COPY . ., it is a reminder to add a .dockerignore listing .git, node_modules and local .env files, which stops secrets and large folders from entering the build context.

Frequently asked questions

Why avoid the latest tag?

It can change underneath you, making builds hard to reproduce.

Why not use ADD?

COPY is explicit; ADD also fetches URLs and extracts archives, which can surprise you.

Is this a complete security scan?

No. It checks a few common issues, not vulnerabilities in the image.

Is my data uploaded?

No. This tool runs entirely in your browser, so what you type or paste is not sent to our servers.

Does it support multi-stage Dockerfiles?

It reads every FROM line, but USER and WORKDIR checks apply to the whole file, so a missing USER in the final stage can go unnoticed if an earlier stage sets one.

Why was FROM node AS build flagged?

The line has no colon, so the linter sees an untagged image. Write FROM node:20-alpine AS build to clear the warning.

Related tools

Explore all developer tools →