OverlayFS: The Backbone of Container Storage

2026-11-15来源 dev.toEnglish
OverlayFS: The Backbone of Container Storage

In order to run a container, you need an image, the image is basically some files that are used by your container. But where exactly are those files stored?

And also during the image build, you run COPY command to move your contents inside of the container in your dockerfile. But where exactly are those files moved?

The contents that are used by containers are inside a specific directory

/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots

If you list the contents of this directory you will find a list of directories

These directories are called layers and this exactly the overlayfs

All of these layers are read-only except for one. Whenever you make a new build, a new layer is created and the existing layers are re-used possible

Your kernel decides which of these layers can be accessed by which processes and this is defined in the process config inside the host os
you can check it with /proc/(pid)/mountinfo, get the PID from the container inspect

原文:https://www.a8q9.cn/en/article/overlayfs-the-backbone-of-container-storage-f6af4b.html

相关文章