The image is meta-information + aufs section with files. A container is an image that is started / stopped. The aufs file section consists of layers. A layer is a section nugget that contains modified and new files. All layers inside the section's aufs are read-only, only the newest (top) layer can be used for writing. When a container is launched, a new layer is created and all changes fall into it.
Suppose there is such an aufs section :
Слои Содержимое +-----------+ 3 | file1.txt | +-----------+ 2 | file3.txt | +-----------+ 1 | file1.txt | | file2.txt | +-----------+
The process inside this section will see the files.
file1.txt из 3 слоя file2.txt из 1 слоя file3.txt из 2 слоя
If the process tries to write something to the files file2.txt, file4.txt and delete file1.txt, then it’s like this
Слои Содержимое +-------------+ 3 | file2.txt | | file4.txt | | <directory> | - директория это файл в котором будет +-------------+ удалена информация о файле file1.txt 3 | file1.txt | т.е. file1.txt пропадет. +-------------+ 2 | file3.txt | +-------------+ 1 | file1.txt | | file2.txt | +-------------+
In Unix systems, directories are files that contain information about other files. When you delete a file from the disk, the file of the directory is changed.