6. What is the difference between CMD vs Entrypoint
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
CMD is an instruction given in the dockerfile which is executed in the container when the image is run. When two CMD instructions are given in the dockerfile, the latest one is executed.
Entrypoint is similar to CMD except that when more instructions are given all are appended.
Dockerfile should specify at least any one of the CMD or Entrypoint commands.