May 2017
Beginner
300 pages
7h 26m
English
The CMD instruction can run any command (or application), which is similar to the RUN instruction. However, the major difference between these two is the time of execution. The command supplied through the RUN instruction is executed during the build time, whereas the command specified by the CMD instruction is executed when the container is launched from the newly created image. Thus, the CMD instruction provides a default execution for this container. However, it can be overridden by the docker run subcommand arguments. When the application terminates, the container will also terminate along with the application and vice versa.
The CMD instruction has three types of syntax, as shown here:
Read now
Unlock full access