What are images?
In Linux, everything is a file. The whole operating system is basically a filesystem with files and folders stored on the local disk. This is an important fact to remember when looking at what container images are. As we will see, an image is basically a big tarball containing a filesystem. More specifically, it contains a layered filesystem.
The layered filesystem
Container images are templates from which containers are created. These images are not just one monolithic block, but are composed of many layers. The first layer in the image is also called the base layer:
The image as a stack of layers
Each individual layer contains files and folders. Each layer only contains the changes to the filesystem with respect to the underlying layers. Docker uses a union filesystem—as discussed in Chapter 3, Working with Containers—to create a virtual filesystem out of the set of layers. A storage driver handles the details regarding the way these layers interact with each other. Different...