Operators pass extra CLI arguments at docker run for a traffic-signal simulator image, but the container seems to ignore them. Which ENTRYPOINT/CMD relationship should they verify?
Select an answer to reveal the explanation.
Short Explanation
ENTRYPOINT is the fixed driver of the bus; CMD is the default destination on the ticket that a passenger can change. Swap them and the bus ignores the destination you shouted at the curb.
Full Explanation
ENTRYPOINT names the executable the container always runs; CMD supplies default arguments that a caller can replace at docker run. For the traffic-signal simulator, operators’ extra CLI arguments typically override CMD when ENTRYPOINT is the fixed binary—especially with exec-form ENTRYPOINT where argv appending is predictable. If that relationship is inverted, or shell-form wrapping interferes, passed arguments appear ignored even though the daemon accepted the run. Verifying Entrypoint versus Cmd in the image configuration is the operable mental model for municipal images that must accept run-time flags.
CMD does not always replace ENTRYPOINT such that runtime arguments are never used; the common operable pattern is fixed ENTRYPOINT plus overridable CMD defaults. ENTRYPOINT is not merely optional defaults while CMD names the immutable executable—that reverses the usual roles. Neither ENTRYPOINT nor CMD is irrelevant, and EXPOSE does not select which binary runs.
Exam caveat: shell form versus exec form changes signal handling and how arguments are appended; prefer exec form for production images so PID 1 and argv behave predictably under orchestration. Operational check: run the simulator with an explicit argument list and inspect the container’s Entrypoint, Cmd, and Args to confirm process argv matches the intended override before blaming application code.