require-dockerfile-cmd-or-entrypoint
Require Dockerfiles to include CMD or ENTRYPOINT.
Targeted pattern scopeâ
- Repository-root Dockerfile instructions.
What this rule reportsâ
This rule reports Dockerfiles that omit both startup instructions.
Why this rule existsâ
Explicit startup instructions reduce runtime ambiguity and make container behavior easier to review and reproduce.
â Incorrectâ
FROM node:22-alpine
WORKDIR /app
RUN npm ci
â Correctâ
FROM node:22-alpine
WORKDIR /app
CMD ["node", "server.js"]
When not to use itâ
Disable this rule if command behavior is intentionally delegated to an external orchestrator entrypoint layer.
Rule catalog ID: R098