Skip to content

overlay2: layers and copy-on-write

Select an icon to see what it is.

Step 1 of 6

The root is an overlay mount

When the container starts, dockerd asks the kernel for an overlay mount. The image layers are lowerdir, read-only. An empty directory is upperdir, where this container's changes go.

$ docker run -d --name web nginx
PrevNext

mount options

lowerdir=/var/lib/docker/overlay2/l/<short>:/var/lib/docker/overlay2/l/<short>:... (short symlinks to <layer>/diff)
upperdir=/var/lib/docker/overlay2/<container>/diff
workdir=/var/lib/docker/overlay2/<container>/work
merged at /var/lib/docker/overlay2/<container>/merged