2.2.1.3 Containerd Snapshot Control
A focused guide to Containerd Snapshot Control, connecting core concepts with practical Docker and container operations.
Containerd snapshot control is containerd's mechanism for managing the layered filesystems that back container images, using a pluggable snapshotter abstraction that determines how image layers are stored, combined, and exposed as a container's root filesystem.
Why Snapshots Exist
An image is composed of multiple layers stacked together, and a running container needs a single, writable filesystem view built from those layers plus a thin writable layer on top for any changes the container makes. The snapshot system is what assembles this combined view efficiently, without copying every underlying layer's data.
ctr snapshots list
This lists the snapshots containerd currently manages, each typically corresponding to a particular image layer or a container's writable layer.
Snapshotter Drivers
containerd supports multiple snapshotter implementations — overlayfs is the most common on Linux, using the kernel's overlay filesystem to combine layers efficiently, but other snapshotters exist for different storage backends or filesystem requirements.
ctr info | grep snapshotter
Creating a Container's Writable Layer
When a container starts, a new snapshot is created representing its writable layer, stacked on top of the read-only layers from its image, so that any files the container creates or modifies are isolated to this top layer.
ctr run docker.io/library/alpine:latest mytask sh -c "echo data > /tmp/file.txt"
Changes made inside this container exist only in its own writable snapshot layer, leaving the underlying image layers untouched.
Committing a Snapshot Into a New Image
The same mechanism that creates a writable layer for a running container can be used to capture that layer's changes as a new image layer, which is the underlying basis for operations like docker commit.
ctr snapshots usage
This reports how much disk space each snapshot consumes, useful for understanding where image and container storage is actually being used.
Why Snapshot Control Matters
Efficient snapshot management is what keeps storage usage proportional to what is actually unique about each image and container, rather than duplicating shared layers across every image or container that happens to use them.