#What is the difference between Docker containers and images?
The image is composed of layers of read-only layers stacked together, while the Docker container is composed of the read-only layer and the read-write layer of the image. The only difference between the two is that the Docker container The top layer is readable and writable.
Image
Image is the unified perspective of a bunch of read-only layers, maybe this The definition is a bit difficult to understand. The following picture can help readers understand the definition of mirroring.
From the left we see multiple read-only layers, which overlap. Except for the bottom layer, all other layers will have a pointer pointing to the next layer. These layers are implementation details inside Docker and can be accessed on the file system of the host (Translator's Note: the machine running Docker). Union file system technology can integrate different layers into one file system, providing a unified perspective for these layers, thus hiding the existence of multiple layers. From the user's perspective, only one file exists system. We can see what this perspective looks like on the right side of the image.
Recommended tutorial: "Docker"
The above is the detailed content of What is the difference between Docker containers and images?. For more information, please follow other related articles on the PHP Chinese website!