This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10621|Reply: 1

Linux Overlay file system in Docker

[Copy link]
Posted on 9/8/2021 1:30:12 PM | | | |
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)





Previous:【Practical Practice】XXL-JOB Distributed Task Scheduling Platform Use and Development Tutorial
Next:[Practice] Troubleshoot the problem of running a Java application on a Linux server and hanging up
 Landlord| Posted on 9/9/2021 12:36:17 PM |
Two tools are recommended for analyzing the Docker image layer
https://www.itsvse.com/thread-10063-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com