Differences between CMD and ENTRYPOINT with example.
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 | ENTRYPOINT |
Can be overridden | Cannot be overridden |
Cannot append additional params | Can be appended |
Command to run when container starts or arg to ENTRYPOINT if specified | Always first command to run when container starts |
Multiple times can be added in the dockerfile but the last line will override the previous | Same behavior as CMD |
Treated as additional param when it is used along with ENTRYPOINT | Always the main command |