Docker Community Forums

Share and learn in the Docker community.

What is the difference between CMD & ENTRYPOINT?

(Nick Hazlett) #1

In a Dockerfile the main purpose of a CMD is to provide defaults for an executing container. This is the default command to be run by the entrypoint. An ENTRYPOINT helps you to configure a container that you can run as an executable. Several Docker images use a default entry point of /bin/sh -c.