XK0-006 Automation, Orchestration, and Scripting Practice Question
A Docker container needs to persistently store data that should survive container removal and be accessible by other containers. Which storage method should be used?
⚠ Common exam trap
Candidates often confuse bind mounts with volumes: both persist data, but only volumes are Docker-managed, portable, and shareable across containers, which is what the question's 'accessible by other containers' requirement demands.
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
✓
Volume
Docker volumes are managed by Docker itself and stored in a dedicated area of the host filesystem (typically /var/lib/docker/volumes on Linux), which is outside the container's writable layer. Because they are independent of the container lifecycle, data in a volume persists even after the container is removed, and the same volume can be mounted into multiple containers simultaneously, enabling data sharing. This makes volumes the recommended mechanism for persistent, shareable container data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Volume
Why this is correct
Docker volumes are stored outside the container's writable layer, in a managed host directory, so their data persists after the container is removed and can be mounted by multiple containers simultaneously, satisfying both persistence and cross-container sharing.
- ✗
Bind mount
Why it's wrong here
A bind mount ties storage to a specific host path, coupling the container to that host's directory layout and complicating access from containers on other hosts. It is tempting because bind mounts do persist data, and they would be correct for sharing a host configuration file or source directory with one container.
- ✗
Container layer
Why it's wrong here
The container layer is writable but is deleted with the container, so data cannot survive removal or be shared with other containers. It is tempting because writes during runtime appear persistent, and the layer would be acceptable only for ephemeral scratch data that no other container needs to read.
- ✗
tmpfs mount
Why it's wrong here
A tmpfs mount stores data in host memory and is removed when the container stops, so nothing survives container removal or is shareable. It is tempting because tmpfs offers fast scratch space, and it would be correct for sensitive temporary files that must never touch disk.
Go deeper
Related to this question
About these practice questions
This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
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.