What is the difference between `CMD` and `ENTRYPOINT`?

  1. CMD is required; ENTRYPOINT is optional
  2. ENTRYPOINT allows arguments; CMD does not
  3. CMD provides defaults; ENTRYPOINT defines fixed commands
  4. They are interchangeable
Correct answer CMD provides defaults; ENTRYPOINT defines fixed commands

Explanation

`CMD` can be overridden, while `ENTRYPOINT` defines the main command that always runs.

Update: Admin added a tag on this question

Topics

By Admin · · 43 views