Aug 15, 2020 in Continuous Deployment

Q.  What is the difference between CMD and ENTRYPOINT in a Dockerfile?

1 Answer

0 votes
Aug 15, 2020

Both CMD and ENTRYPOINT instructions define what command gets executed when running a container. There are few rules that describe their co-operation.

  1. Dockerfile should specify at least one of CMD or ENTRYPOINT commands.
  2. ENTRYPOINT should be defined when using the container as an executable.
  3. CMD should be used as a way of defining default arguments for an ENTRYPOINT command or for executing an ad-hoc command in a container.
  4. CMD will be overridden when running the container with alternative argument
Click here to read more about Continuous Deployment
Click here to read more about Insurance

Related questions

0 votes
Aug 15, 2020
+1 vote
Aug 15, 2020 in DevOps