Container Storage
Container storage provides persistent data access for stateful containerized workloads. It covers volume types, storage drivers, CSI plugins, and the strategies for attaching durable storage to containers whose processes are otherwise ephemeral.
itVirtualization, containers, and orchestration | OpenSkills.info
Intro
Container Storage
A container starts with a filesystem assembled from image layers. It also gets a thin writable layer for changes made while it runs.
That writable layer makes the container usable. It does not make the container a safe home for durable data.
Container storage is the practice of deciding where each kind of runtime data belongs. The key choice is between container-local state and mounted storage.
The first mental model
Picture a container filesystem as two parts:
mounted storage selected paths with separate lifecycles
------------------ ---------------------------------------
container view = image layers + writable layer + mounts
read-only container-local external
Image layers supply the starting files. The writable layer records runtime changes. Mounts place other storage at chosen paths inside the container.
All three appear in one directory tree to the application. Their lifecycles and operational properties differ.
The writable layer
Every container gets its own writable layer above the image's read-only layers. New files and changed files appear there.
Storage drivers implement this layered view. Many use copy-on-write. A read can use an unchanged file from a lower image layer.
The first modification copies that file into the writable layer. Later changes affect the copy, not the image layer below it.
This design saves space when many containers share one image. Each container stores only its own changes.
The writable layer follows the container. Removing the container removes that layer. A replacement container starts with a fresh writable layer.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.docker.com/engine/storage/
Supports
- Container writable-layer lifecycle and uniqueness
- Volume, bind-mount, and tmpfs categories
- Mounted paths as files or directories inside the container filesystem
- https://docs.docker.com/engine/storage/volumes/
Supports
- Engine-managed volume lifecycle and use cases
- Named and anonymous volume behavior
- Destination masking and empty-volume population
- Sharing, backup, restore, and migration guidance
- https://docs.docker.com/engine/storage/bind-mounts/
Supports
- Host-path mapping and common use cases
- Destination masking and daemon-host scope
- Default write access, read-only mode, security impact, and host coupling
- https://docs.docker.com/engine/storage/tmpfs/
Supports
- Linux memory-backed temporary mount lifecycle
- Nonpersistent use cases, size options, and swap caveat
- https://docs.docker.com/engine/storage/drivers/
Supports
- Storage-driver role for image and writable layers
- Stackable layers and copy-on-write behavior
- Writable-layer performance and disk-usage considerations
- https://docs.kernel.org/filesystems/overlayfs.html
Supports
- Upper and lower filesystem composition
- Copy-up behavior, whiteouts, and merged directories
- Overlay filesystem durability and permission mechanics
- https://github.com/opencontainers/runtime-spec/blob/main/config.md
Supports
- Container root filesystem configuration
- Read-only root behavior
- Additional mount fields and ordering
- https://github.com/opencontainers/image-spec/blob/main/layer.md
Supports
- Image layers as filesystem changesets
- Ordered additions, modifications, removals, and whiteouts
- https://kubernetes.io/docs/concepts/storage/
Supports
- Cluster storage learning path
- Kubernetes volumes, persistent volumes, claims, storage classes, and dynamic provisioning
