$linuxjunkies
>

overlay driver

also: overlay, overlay2, overlay filesystem

A Docker storage driver that layers a read-only base image with a thin read-write layer, using kernel union filesystem technology to efficiently stack multiple filesystem views into one.

The overlay driver is a copy-on-write (CoW) storage mechanism used by Docker and other container runtimes to manage container filesystems. It combines a read-only lower layer (the image) with a read-write upper layer (the container) using the kernel's overlay filesystem, so changes appear isolated without copying entire files.

When a container modifies a file, only the changed portions are written to the upper layer, keeping the base image pristine. Multiple containers can safely share the same image layers in memory, dramatically reducing storage and startup overhead compared to full copies.

Example: A container running Ubuntu might have a 100 MB base image layer, but the writable overlay layer for one running container could be just 5 MB—much smaller than duplicating the whole image. The kernel transparently merges both layers so the container sees a complete filesystem.

Modern Linux systems typically use overlay2 (the improved version), which efficiently handles multiple lower layers and is the default overlay driver in current Docker installations.

Related terms