Docker: ENTRYPOINT vs. CMD

ENTRYPOINT is the process run when the container starts (PID 1).

CMD is the argument for the entrypoint.

When you run the container without arguments, this will execute ENTRYPOINT + CMD:

Shell

When you run the container with arguments, this will execute ENTRYPOINT + arguments:

Shell

When you want to override the entrypoint use the –entrypoint flag:

Shell


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *