What does #(nop) mean in docker history?

NOP stands for “no operation”.

Docker “runs a shell” for every layer. All the docker commands (or layers) in the Dockerfile except the RUN command show up in the history as empty or commented out shell commands. The # sign marks the start of the comment and anything after that will be skipped by the /bin/sh. Similarly if you typing in the terminal:

user@machine $ echo hello world
hello world
user@machine $ #But none of these lines starting with # do anything
user@machine $ #echo hello world

The non-RUN commands will not need to be interpreted by the shell, but instead are processed by docker internally.

The history (including the non-RUN commands) can be used by the layer cache to skip processing in case the same command has been run previously.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)