Storage drivers, snapshotters and copy-on-write
Docker image and container filesystem data are managed by an engine storage backend. Copy-on-write means shared read-only image data can be reused until a container needs its own change. A volume is a separate data path; it is not the image storage driver. The backend affects space use and filesystem performance.
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.
Conceptual OverlayFS-style modelLower image: /app/config.txt = base, /app/help.txt = helpContainer A upper: /app/config.txt = customContainer B upper: no changesA reads custom; B reads baseA hides help.txt using deletion marker (conceptual whiteout)Both containers can share the original lower image data. A modification may copy a lower file into an upper writable layer, then change that copy; B retains its own view. A deletion marker can hide a lower file without removing that file from the underlying image. This is a conceptual overlay model, not a universal implementation of every backend. Docker documents the containerd image store as the default for fresh Engine 29.0+ installations, while upgrades may keep the classic graph-driver backend. Snapshotters manage filesystem views in the containerd store; overlay2 is a classic driver. Check the active server version and storage information in an approved context rather than assuming a backend from the CLI version. The current docs also note a userns-remap incompatibility with the containerd image store. Do not switch backends or edit their internal directories in this lesson. For the containerd image store, Docker documents that daemon data-root alone does not move image contents and snapshots stored by containerd. Switching storage backends can hide prior objects from the active view. Inventory and migration require a separate approved plan.
Common mistake
Deleting a large image file in a later layer does not necessarily reclaim bytes from the earlier image layer. Rebuild the image with an appropriate instruction sequence instead.
Manual practice
Predict the file contents seen by A and B, and what remains in the image. Explain why a volume is not a storage driver and why an upgrade may retain a different backend.
Worksheet: lab-fixtures/docker-storage-engineering/06-storage-backends/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Storage drivers, snapshotters and copy-on-write — Knowledge check
Reason about storage behavior and recovery evidence.
What does B read from config.txt?
What is the documented default for fresh Engine 29.0+ installations?
Does a whiteout in an upper layer erase the original lower file?