NOP means no operation.
Docker launches a shell for each layer. All docker commands (or layers) in the Docker file, except for the RUN command, appear in the history as empty or commented out shell commands. The # sign marks the beginning of the comment, and all that will be skipped with /bin/sh after that. Similarly, if you type on the terminal:
user@machine $ echo hello world hello world user@machine $
Non- RUN commands should not be interpreted by the shell, but are processed by the docker inside.
History (including non- RUN commands) can be used by the layer cache to skip processing if the same command was executed earlier.
source share