RUN Command: The RUN command will basically execute the default command when we create the image. It will also commit image changes for the next step.
There may be more than 1 RUN command to assist in the process of creating a new image.
CMD Command: CMD commands simply set the default command for the new container. This will not be done during assembly.
If the docker file has more than 1 CMD command, all of them are ignored except the last one. Since this command will not do anything, it will simply set the default command.
Bharat Raj Oct 29 '18 at 10:15 2018-10-29 10:15
source share