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

Docker Fundamentals Medium

Docker Fundamentals — Medium

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

Key points

  • ENTRYPOINT defines the main executable in a Docker container
  • CMD provides default arguments for the ENTRYPOINT
  • ENTRYPOINT can only be overridden with --entrypoint flag

Ready to go further?

Related questions