Docker storage often feels like a black box — images appear, containers run, disk space disappears, and volumes behave magically.
This post explains how Docker actually stores data on disk.
1. How Docker Images Are Stored (The Layered Filesystem)
Docker uses union filesystem concepts (implemented via OverlayFS) to build images efficiently.
Each instruction in your Dockerfile creates a new read-only layer .
Most RUN , COPY , and ADD instructions create filesystem layers
Instructions like ENV , LABEL , CMD , and EXPOSE only add metadata (no filesystem layer)
Every layer has a unique SHA256 ID
Layers are immutable and shared across images (deduplication)
Key Idea:
Docker images are stacks of immutable layers, not a single filesystem.
2.…