Skip to main content
Dockerfile has no stages to build.

Description

Every Dockerfile must contain at least one FROM instruction to define a build stage. A file with only ARG, RUN, COPY, or other instructions but no FROM always fails at build time with:
This check catches the problem before any other linting runs, aborting with exit code 4 (syntax error). Common causes:
  • A FROM line was accidentally deleted during a refactor
  • An AI-generated patch removed or failed to include a FROM instruction
  • A Dockerfile fragment was saved as a standalone file

Examples

Bad

Good

  • hadolint/DL3061 detects non-ARG instructions that appear before the first FROM. When no FROM exists at all, tally/require-stages fires first and DL3061 is not reached.