mediumMultiple ChoiceObjective-mapped
XK0-006 A container named web2 exited with status 0 Practice Question
Exhibit
Refer to the exhibit. Exhibit: $ podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a1b2c3d4e5f6 docker.io/library/nginx:latest nginx -g 'daemon of… 2 hours ago Up 2 hours (unhealthy) 0.0.0.0:80->80/tcp web1 f6e5d4c3b2a1 docker.io/library/nginx:latest nginx -g 'daemon of… 3 hours ago Exited (0) 3 hours ago web2
A container named web2 exited with status 0. Which of the following is the most likely reason?
⚠ Common exam trap
A common mix-up: candidates assume exit code 0 always means the container completed its intended work, but CompTIA tests the nuance that a manual `docker stop` can also produce exit code 0 if the process handles the shutdown gracefully.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The container was stopped manually with docker stop
Exit code 0 indicates a successful termination. When a container exits with status 0, it means the main process (entrypoint or command) completed its task without errors. Option C is correct because `docker stop` sends a SIGTERM signal to the container's PID 1, allowing it to shut down gracefully; if the process handles the signal and exits cleanly, the exit code will be 0.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The container ran a task and completed
Why it's wrong here
Nginx is a daemon, not a one-time task.
- ✗
The container's entrypoint crashed
Why it's wrong here
A crash would typically result in a non-zero exit code.
- ✓
The container was stopped manually with docker stop
Why this is correct
docker stop sends SIGTERM, causing a clean exit with code 0.
- ✗
The container ran out of memory
Why it's wrong here
Out-of-memory kills result in exit code 137, not 0.
Go deeper
Related to this question
About these practice questions
Courseiva writes every XK0-006 question from scratch — 979 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.