What is the relationship between the docker container and the image
Today, what the editor shares with you is the relationship between docker containers and images. I believe many people do not know much about it. In order to make you understand better, I have summarized the following contents and let's move on. I'm sure you'll get something.
The docker image is actually a template, similar to our common ISO image, is a template. Use mirroring common applications or systems, called a container.
1.docker Mirror
Is a read-only template for the docker container runtime, and images can be used to create docker containers. Each mirror consists of a series of layers (layers), and Docker uses UFS (federated file system) to federate these layers into a separate image.
UFS allows files and folders in independent file systems to be transparently overwritten to form a separate coherent file system. Because of the existence of these mirror layers, docker is so lightweight that when you change a docker image, say, upgrade to the latest version of a program, such a new layer will be created, without replacement or re-creation, just upgrade, and layers make it easy and fast to distribute docker images.
2.docker container
Docker uses containers to run applications, and a Docker container contains all the environments that an application needs to run. Each Docker container is created from a Docker image. Docker containers can be run, started, stopped, moved, and deleted. Each Docker container is an independent and secure application platform.
A container is a running instance created from an image. It can be started, started, stopped, and deleted. Each container is a platform for mutual isolation and security.
Think of the container as a simple version of the Linux environment (including root user rights, process space, user space, cyberspace, etc.) and applications running in it.
Note: the image is read-only. When the container starts, it creates a writable layer as the top layer.
So much for sharing about the relationship between docker container and image. I hope the above content can be used as a reference for you. If you like this article, you might as well share it for more people to see.