Docker - difference RUN, CMD and ETRYPOINT

less than 1 minute read

1. CMD vs ENTRYPOINT
The ENTRYPOINT specifies a command that will always be executed when the container starts. The CMD specifies arguments that will be fed to the ENTRYPOINT. But without ENTRYPOINT, CMD can execute the command as well.

2. RUN vs CMD
RUN - command triggers while we build the docker image.
CMD - command triggers while we launch the created docker image.

More details.
http://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/