3.1.1 Image Filesystem Snapshot
A focused guide to Image Filesystem Snapshot, connecting core concepts with practical Docker and container operations.
An image filesystem snapshot is the complete, assembled view of every layer in an image, combined in order, representing exactly what a container's filesystem will look like the moment it starts, before any changes the container itself might make.
A Point-in-Time, Fixed View
Because every layer in an image is fixed and read-only, the combined snapshot they produce is entirely deterministic — building or pulling the same image always results in the exact same filesystem snapshot, regardless of when or where it happens.
docker run --rm myapp:1.0 find / -maxdepth 2
Run on any host, against the same image, this produces identical output, since the underlying filesystem snapshot the image defines does not vary by host or by time.
Snapshots Are Computed, Not Stored Whole
The combined snapshot is not stored as a single, separate copy; it is computed on demand by the storage driver, which overlays each layer in order to produce the merged view a container actually sees.
docker info --format '{{.Driver}}'
The active storage driver (commonly overlay2) is responsible for assembling this snapshot efficiently every time a container starts, without duplicating the underlying layer data to do so.
Inspecting the Snapshot's Composition
The layers that together produce a given image's filesystem snapshot can be examined individually, which is useful for understanding exactly which build step introduced a particular file or change.
docker history --no-trunc myapp:1.0
Comparing Snapshots Between Image Versions
Because each image version produces its own deterministic filesystem snapshot, comparing two versions of the same image reveals exactly what changed between them at the filesystem level.
docker run --rm myapp:1.0 sha256sum /app/main.py
docker run --rm myapp:1.1 sha256sum /app/main.py
A difference in the reported hash here indicates the file changed between these two image versions, independent of any other metadata about the change.
Why the Filesystem Snapshot Concept Matters
Thinking of an image as a fixed filesystem snapshot, rather than as a set of installation instructions to be re-executed, is the key mental shift that explains why images are reproducible in a way that traditional, script-based environment setup is not.