The Dockerfile Linter checks a pasted Dockerfile against widely-used best-practice and security rules — the same kinds of issues hadolint flags — and explains each finding so you can fix it. Everything runs in your browser.
How it works
The linter first tokenises the Dockerfile into instructions, joining lines that end with a backslash continuation and skipping comment lines. It then applies a rule set to each instruction and to the file as a whole:
- Base image pinning — warns on untagged images and on the
latesttag, which is not reproducible. - Package manager hygiene — flags
apt-get installwithout--no-install-recommends,apt-get updatein its own layer, missing apt list cleanup, andapk addwithout--no-cache. - Layer and path correctness —
cdinside RUN (use WORKDIR), relative WORKDIR paths, andADDwhereCOPYis the safer choice. - Security — running as
rootat the final stage, use ofsudo, and piping acurl/wgetdownload straight into a shell withoutpipefail. - Runtime correctness — shell-form
CMD/ENTRYPOINT(use the JSON exec form so signals are forwarded) and a missingHEALTHCHECK.
Example
A line like the following:
RUN apt-get update && apt-get install curl
triggers a warning to combine update and install in one layer and to add
--no-install-recommends, plus a note to clean /var/lib/apt/lists in the same
RUN so the image stays small.
Notes
Severities are advisory: error marks things that are almost always wrong,
warning marks strong best practices, and info marks size or hardening
optimisations. This linter is a quick preview — keep hadolint in CI for full
rule coverage and shellcheck integration.