Dockerfile Safety Rules
Allowed Modifications
You MAY add:
ARG-- build argumentsENV-- environment variablesCOPY-- copy files into the imageRUN-- install packages or run build commandsEXPOSE-- declare ports
Forbidden Modifications
You MUST NOT change:
FROM-- base image (changing this breaks the build chain)CMD/ENTRYPOINT-- the container's startup commandUSER-- the runtime user (security context)WORKDIR-- the working directory
You MUST NOT remove:
- Existing
COPY,RUN, orCMDlines - Running processes from
CMD(e.g., removing a sidecar process)
When to Stop
If a task requires changing FROM, CMD, USER, or WORKDIR, stop and report that it requires Architect review. Do not proceed.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.