require-dockerfile
Require a repository-root Dockerfile when using the Docker preset.
Targeted pattern scopeâ
- Repositories that opt into the Docker preset without committing a root
Dockerfile.
What this rule reportsâ
This rule reports repositories using the Docker preset when no repository-root Dockerfile exists.
Why this rule existsâ
If a repository is supposed to describe container packaging as code, the build instructions need to live in version control, not only in external CI or registry jobs.
â Incorrectâ
// Docker preset enabled, but no Dockerfile is committed.
export default [];
â Correctâ
FROM node:22-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
CMD ["npm", "start"]
When not to use itâ
Disable this rule if the repository does not actually build a container image.
Rule catalog ID: R068