require-dockerfile-from-instruction
Require Dockerfiles to declare a FROM instruction.
Targeted pattern scopeâ
- Repository-root
Dockerfileinstruction set.
What this rule reportsâ
This rule reports Dockerfiles missing any FROM statement.
Why this rule existsâ
A valid Docker build must declare a base image stage. Enforcing FROM avoids
broken or ambiguous image definitions.
â Incorrectâ
WORKDIR /app
CMD ["node", "server.js"]
â Correctâ
FROM node:22-alpine
WORKDIR /app
CMD ["node", "server.js"]
When not to use itâ
Disable this rule only if Dockerfile generation guarantees FROM elsewhere.
Rule catalog ID: R105