This post is a small diagram discussing overlay file systems used by containers like docker for saving disk space. The “layers” we see as docker runs through every command of Dockerfile
is result of docker building another lower directory (possibly reusable) to the cascaded overlay file system used for a container. Since container systems like docker use overlays, re-building an existing image with different tag doesn’t go through the build steps like installing packages again! :)
sudo mount -t overlay overlay -o lowerdir=./lower,upperdir=./upper,workdir=./parent ./parent
sudo mount -t overlay overlay -o lowerdir:./lower_1:./lower_2:./lower_3,upperdir=./upper,workdir=./parent ./parent