Storage lifecycle and mount boundaries
A mount connects a filesystem or directory to a path inside a container. Its data lifetime depends on the backing storage, not merely on whether the container is running. For example, a named volume holding invoices can survive replacement of the application container, while a temporary working file in the writable layer cannot survive removal of that container.
Worked storage scenario
Use the synthetic scenario offline first. No real data, daemon changes, host mounts or production resources are required. Commands, if shown, are documented examples rather than observed output. Any real Docker check requires an approved disposable context. Keep the exercise offline. For any separately authorized Docker verification, identify the effective endpoint (including DOCKER_HOST and DOCKER_CONTEXT) before sending even read-only Engine requests. Record server version and platform; redact sensitive metadata.
Synthetic application inventory/data/invoices.csv : named volume, business records/cache/render.tmp : tmpfs, disposable cache/app/session.tmp : writable layer, disposable scratch/config/settings.ini : read-only bind mount, host-owned configWhen the container stops, its writable layer and named volume still exist. A tmpfs mount is temporary; do not rely on its contents after a stop. Removing the container removes its writable layer, not the named volume or host file. A new container must mount the same named volume at the correct destination to see the records. A mount hides the underlying files at its target while attached; an empty Docker volume can initially receive existing image files at the target unless copy-up is disabled. Read-only describes access through this mount, not other writers to the backing storage. Document owner, retention and restore requirements independently for every path. The named volume is expected to survive ordinary container removal, not explicit volume removal or loss of the backing storage. When recreating the container, verify the intended volume identity, destination and retained records; an empty target is not evidence that the source was erased.
Common mistake
Do not classify every file under /app as image content: writes can land in a mount. Inspect the declared mount destinations and actual application paths before replacement.
Manual practice
Classify the four paths by what survives stop, removal and recreation. Explain which mount must be reattached and which data needs a backup.
Worksheet: lab-fixtures/docker-storage-engineering/01-mount-lifecycle/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Storage lifecycle and mount boundaries — Knowledge check
Reason about storage behavior and recovery evidence.
Which data is expected to survive removal of the application container?
What happens to files underneath an active mount target?
Does a read-only mount stop every other writer to the same storage?