Skip to content

Menu

Dockerfile Linter

Free Dockerfile linter. Flags latest or untagged base images, apt-get without cleanup, root users, ADD vs COPY, extra CMDs and more. Runs in your browser.

Runs entirely in your browserDevOpsFree, no sign-up
Loading tool

01What is Dockerfile Linter?

Dockerfile Linter reads a Dockerfile you paste and lists lines that go against Docker's own best-practices guide and Dockerfile reference. Small Dockerfile habits cause large problems later: builds that change without warning, bloated images, containers running as root and processes that ignore stop signals. This tool points at those lines before you build. It works in three steps. First it joins backslash continuations and skips comments, so a long RUN counts as one instruction. Next it checks each instruction against a set of rules. Finally it reports each finding with its line number, a rule name and a severity of error, warning or info. The Dockerfile reference says a Dockerfile must start with FROM, with only ARG allowed before it, so anything else is an error. FROM lines with no tag or with the latest tag are flagged, since tags are mutable and the next build may pull a different image. Images pinned by digest, scratch, earlier stage names and images set from a build argument are not flagged. For apt-get, the best-practices guide asks for update and install in the same RUN. Otherwise a cached update layer can install stale packages. The tool also checks that install uses -y, which is an error when missing because the build cannot answer a prompt. It checks for --no-install-recommends and for removal of /var/lib/apt/lists/* in the same RUN, so the package index is not kept in the layer. It warns when ADD copies plain local files, because Docker recommends COPY for that and ADD for remote URLs or tar archives you want extracted. It flags more than one CMD or ENTRYPOINT in a stage, since only the last one takes effect. It notes shell-form CMD and ENTRYPOINT, because exec form lets your process receive signals directly. It also warns about relative WORKDIR paths, RUN cd, sudo, the deprecated MAINTAINER instruction, a final stage with no USER or with USER root, and a missing HEALTHCHECK. As an example, paste FROM node, then RUN apt-get install curl, then CMD node server.js. You get a warning that node has no tag, so Docker pulls latest. The RUN line gets an error for the missing -y, warnings for no apt-get update and no list cleanup, and an info note about recommends. CMD gets a shell-form note, and the file is also flagged for no USER and no HEALTHCHECK. The checks are pattern based. They do not run a shell parser, resolve build arguments, or look inside scripts that RUN calls, so treat results as hints. A missing HEALTHCHECK is fine if Kubernetes or ECS runs its own probes. For Docker's official rule set, run docker build --check.

Backend and DevOps engineers who write or review Dockerfiles. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Dockerfile Linter

  1. Paste your Dockerfile into the input box, or pick an example
  2. Read the findings list, sorted by line number
  3. Fix errors first, then warnings, and decide on each note
  4. Copy the findings to paste into a review comment

03Worked examples

Input: FROM ubuntu MAINTAINER me RUN apt-get update RUN apt-get install curl ADD . /app WORKDIR app CMD npm start CMD ["node", "server.js"]
Result: 13 findings: from-untagged and no-user (L1), maintainer-deprecated (L2), apt-update-alone (L3), apt-install-no-update, apt-no-recommends, apt-no-cleanup, apt-no-yes (L4), add-instead-of-copy (L5), workdir-relative (L6), cmd-shell-form and multiple-cmd (L7), no-healthcheck (L8)
Most beginner Dockerfiles hit several of these at once. The only error is apt-get install without -y, which stops a non-interactive build.
Input: # syntax=docker/dockerfile:1 FROM node:24-slim AS build WORKDIR /app COPY package*.json ./ RUN npm ci FROM node:24-slim RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ && rm -rf /var/lib/apt/lists/* COPY --from=build /app /app USER node HEALTHCHECK CMD curl -f http://localhost:3000/ || exit 1 CMD ["node", "/app/server.js"]
Result: No findings.
A multi-stage build with pinned slim images, one combined apt-get RUN, a non-root USER, a HEALTHCHECK and exec-form CMD passes every rule.
Input: FROM python:latest USER root CMD ["python"]
Result: L1 warning from-latest: Base image "python:latest" uses the "latest" tag... L2 warning user-root: The final USER is root... L3 info no-healthcheck: No HEALTHCHECK...
The latest tag can change between builds, and an explicit USER root is flagged the same as having no USER. Messages are trimmed here.
Input: FROM python:3.13-slim RUN sudo pip install requests RUN curl -fsSL https://example.com/install.sh | sh COPY . . CMD python app.py
Result: L1 warning no-user: The final stage has no USER, so the container runs as root... L2 warning run-sudo: Avoid sudo in a Dockerfile... L5 info cmd-shell-form: CMD uses shell form... L5 info no-healthcheck: No HEALTHCHECK...
Builds already run as root, so sudo is not needed. Messages are trimmed; note the linter does not check for curl piped to sh.

04Common use cases

  • Reviewing a Dockerfile in a pull request before it merges
  • Finding why an image is larger than expected because of apt caches
  • Catching an unpinned base image before a release build
  • Checking that a production image does not run as root
  • Teaching new team members the reasons behind Docker's best practices

05Tips

  • Pin a version tag at minimum; pin a digest when you need repeatable builds, and let Dependabot bump it.
  • Put apt-get update, install and the rm -rf /var/lib/apt/lists/* cleanup in one RUN.
  • If Kubernetes or ECS runs health probes, the missing HEALTHCHECK note is safe to ignore.
  • Run docker build --check locally for Docker's own rule set.

06Related concepts

Dockerfile, base image tag, multi-stage build, image layer, non-root container, exec form.

Frequently Asked Questions

What is Dockerfile Linter?

Dockerfile Linter is a free, browser-based developer tool on AIDToolStack. Free Dockerfile linter. Flags latest or untagged base images, apt-get without cleanup, root users, ADD vs COPY, extra CMDs and more. Runs in your browser. It requires no installation or sign-up and works entirely in your browser.

Is Dockerfile Linter free to use?

Yes. No sign-up, no fees and no usage cap.

Does Dockerfile Linter store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe