Union Mount Filesystems (OverlayFS)
The Technical definition of Union Mount Filesystems – “Union Mount Filesystems (overlayfs) allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new virtual filesystem.”
OverlayFS is an example of Union Mount Filesystems that Docker uses. It allows you to take separate file systems and combine them into a unified view that you can then operate on. Let’s understand this with the help of an example:
So in the image you can see we have a lower file system and an upper file system with various files. We have got file – 1, file -2b and file – 4 in the lower layer. And in the upper layer we have a different file that is file – 3 and then we also have a deleted file file – 4. When we combined these layers into the overlay we ended up with a combination of those two things where the upper layer takes precedence over the lower layer and so we have file – 1, file – 2b and file – 3.
While namespaces and C groups are sort of what make containers possible. This concept of a union map file system is what makes containers practical. Because of this layered approach we are able to share lower layers and cache those layers such that the amount of data that needs to be transferred and stored for container images is much smaller. This is because many images can share a common lower layer and then only some subset of the upper layers can be modified which enables us to move less data when we need to get a container image onto a system and allocate less space if we’re running multiple copies of the same container.
Understanding the Docker Desktop Architecture and Linux Building Block for Containers
In this article we are going to do a technology deep dive and start understanding the foundational Linux kernel features that software like Docker is using to make the containers work and provide those isolated environments that we all use. then towards the end of this section, we’ll also take a look at the docker system architecture.
Contact Us