To understand the docker images
, you should better understand the main element of the Docker mechanism the UnionFS
.
Unionfs is a filesystem service for Linux, FreeBSD and NetBSD which
implements a union mount for other file systems. It allows files and
directories of separate file systems, known as branches, to be
transparently overlaid, forming a single coherent file system.
The docker images
сonsist of several layers(levels). Each layer is a write-protected filesystem, for every instruction in the Dockerfile
created own layer, which has been placed over already created. Then the docker run
or docker create
is invoked, it make a layer on the top with write persmission(also it has doing a lot of other things). This approach to the distribution of containers is very good in my opinion.
Disclaimer:
It is my opinion which I'm found somewhere, feel free to correct me if I'm wrong.