Menu

Post image 1
Post image 2
1 / 2
0

Docker Storage & Volumes Internals: Understanding Layers, OverlayFS & Persistence

DEV Community·Sreekanth Kuruba·21 days ago
#GbQsekrw
Reading 0:00
15s threshold

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) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More