With the Linux kernel starting from 3.18, the Overlay file system has been included in the main line development and maintenance, so far, after continuous improvement and development, the position of the Overlay file system has become more and more important, and its role and advantages have become more and more significant in all aspects.
The overlayfs file system is similar to aufs, and compared with aufs, overlay implementation is more concise.
Overlay Fundamentals
The Overlay file system is similar to a stacked file system and is not itself like other traditional file systems (jffs2, ext4, fat...). In this way, it directly participates in the division of disk space and node storage. It is more like a leather company, relying on and building on top of other traditional file systems, "merging" the differences in the Chinese content of the underlying traditional file system, "merging", and then presenting it to users. Therefore, the file system root directory that the user sees is actually a "collection" of the file system directory that overlays the "merged".
Overlay in Docker
There are many types of Docker storage drivers, such as AUFS, DeviceMapper, BtrFS, ZFS, etc., and of course, OverlayFS.
/var/lib/docker/overlay2/xxx 中的 xxx 在layerdb里面对应sha256/xxx的cache-id
Docker images and containers
Image: A stacked "merge" of one or more read-only layers, "merged" into a unified file system through an overlay file system, hiding the details of multiple read-only layers from the user's point of view, and only one unified file system exists.
Container: Like an image, it is also a stack "merge" of one or more read-only layers, except that the top layer has an additional layer of a unified file system that can read and write to the mirror. Namely: container = image + read/write layer;
After installing docker, the default installation directory for docker images is /var/lib/docker
See how much space your disk is occupied
View directory mount points
Statistics on /var/lib/docker/ disk footprint
(End)
|