The ENTRYPOINT instruction specifies the executable that always starts first, while CMD supplies default arguments that are used only if the user does not provide their own. Because the container is run with the extra argument --debug, Docker replaces the CMD list with the supplied argument list but keeps the ENTRYPOINT intact. Therefore the final argument vector becomes ["./app", "--debug"]. The supplied --debug flag completely overrides the default --port=8080 argument, so only the ENTRYPOINT plus the new flag is executed.
Incorrect answers either omit the flag, retain the overridden --port=8080 value, or combine both flags-all of which do not match Docker's documented behavior.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the ENTRYPOINT in a Dockerfile?
Open an interactive chat with Bash
How do ENTRYPOINT and CMD work together in Docker?
Open an interactive chat with Bash
What happens if a Docker image has both ENTRYPOINT and CMD, but CMD is not overridden at runtime?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access