I presume you are a tad bit familiar with Docker and know basics like running docker containers etc.
In previous articles we have discussed updating docker container and writing docker files.
A container image is built in layers or it is a collection of layers each Dockerfile instruction creates a layer of the image. For example consider the following Dockerfile.
Since there are a total of three Dockerfile commands the image built from this Dockerfile will contain a total of three layers. .
You can confirm that by building the image.
And then using the command docker image history on the built image.
Ignore the last 8216ltmissinggt8217 layer.
Each of these layers is read-only. This is beneficial because since these layers are read-only no process associated with a running instance of this image is going to be able to modify the contents of this image therefore these layers can be shared by many containers without having to keep a copy for each instance. But for the containers8217 processes to be able to perform rw another layer is added on top of the existing RO layers when creating the containers this is writable and not shared by other containers.