Lint a Dockerfile
Check a Dockerfile for common mistakes, from floating FROM tags to curl piped into sh, and get rule IDs, line numbers and severities in one report.
Working…
Questions people ask
- Which rules are checked?
- Twelve, each with an ID: DF001 and DF002 for floating FROM tags and :latest, DF003 and DF004 for apt-get update without install and installs without --no-install-recommends, DF005 for the deprecated MAINTAINER, DF006 for remote ADD, DF007 and DF010 as file-wide checks for a missing USER and HEALTHCHECK, DF008 for sudo, DF009 for curl or wget piped into a shell, DF011 for raw archives under COPY, and DF000 for instruction words the builder does not run.
- Is this a full hadolint replacement?
- No, and the report says so. The rule set is deliberately small: it catches the common mistakes people actually ship, with bounded findings. It does not carry hadolint's several hundred rules, and hadolint itself is a Haskell binary that cannot run inside this tool's sandbox, which is part of why a focused set was chosen.
- How are line continuations and heredocs handled?
- As the Dockerfile format specifies. Backslash continuations are joined into one logical instruction, so a rule fires once for the whole instruction; heredoc blocks opened with <<DELIM are consumed until the delimiter line, so the body is never parsed as instructions and never produces spurious findings.
- What do findings look like?
- Every finding names a rule ID, a severity (error, warning or info), and the line where the instruction starts. The report opens with counts by severity and closes with its scope, so you know exactly which checks ran before deciding what to fix.
- What happens to my files?
- The upload is removed as soon as processing finishes; the report stays downloadable for about 10 minutes, then it is deleted automatically.