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. Storage Driver: overlay2 (Default on Linux) Modern Docker uses the overlay2 storage driver , based on the Linux kernel’s OverlayFS (a union filesystem implementation) .…