Tools / Dockerfile Linter

Dockerfile Linter.

Check a Dockerfile for unpinned images, apt-get pitfalls, shell-form CMD, root users and baked-in secrets.

Runs in your browser

info shows everything; error shows only problems that break the build or the image.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Summary
Issues

About Dockerfile Linter

The Dockerfile Linter reads your Dockerfile the way the Docker builder does, joining line continuations, skipping comments, honouring the escape parser directive and understanding BuildKit heredocs, and then checks every instruction against a set of well-known best practices. Each finding has a line number, a severity and a short explanation of why it matters. Errors are things that break the build or silently do something else: an unknown instruction, a file that does not start with FROM, an EXPOSE with a host mapping such as 8080:80, a COPY of several files to a destination that does not end in "/", and a CMD that looks like JSON but uses single quotes, which Docker then runs through /bin/sh instead. Warnings cover reproducibility and security: images without a tag or with :latest, apt-get install without -y, apt-get update in its own RUN layer, piping curl into sh, sudo, chmod 777, secrets in ENV or ARG, COPY --from pointing at a stage name that does not exist, and a final image that runs as root. Notices are smaller wins such as --no-install-recommends, cleaning /var/lib/apt/lists, pip --no-cache-dir and preferring WORKDIR over cd. For example, "CMD nginx -g 'daemon off;'" is flagged because the shell-form process does not receive SIGTERM, so docker stop waits ten seconds and then kills it. The rules are inspired by hadolint but implemented independently, and shell commands are inspected with simple heuristics rather than a full shell parser, so treat findings as advice. The Dockerfile never leaves your browser.

How to Use

  1. Paste your Dockerfile.
  2. Read the findings, starting with errors and warnings.
  3. Fix the lines and paste again until the list is clean.

Frequently Asked Questions

Is this the same as hadolint?

No. The rules cover the same common problems as hadolint's DL rules but are implemented separately, and shell commands inside RUN are checked with heuristics instead of ShellCheck.

Why is "FROM node" a warning?

Without a tag Docker pulls node:latest, which changes over time, so the same Dockerfile builds different images. Pin a version such as node:20.11-alpine or a digest.

Why should CMD use the JSON form?

In shell form your process runs as a child of /bin/sh and does not receive SIGTERM, so containers stop slowly and cannot shut down cleanly. The exec form ["node", "server.js"] runs it directly.

Is my Dockerfile uploaded?

No. Linting happens in your browser.

Related Tools