In the life cycle of a docker container, a docker container is roughly divided into the following three states from creation to running deployment:
Dockerfile
Template file used to create image images. For management and security reasons, docker officially recommends that all image files should be created by dockerfile. Currently, many users use docker as a virtual machine, or even in a container. Install SSH, which is inappropriate from a security perspective.
Image
Image file, compared with the concept of PC side, we can understand it as an executable software package on the server side. Once the package is generated, if there are security issues, these issues will also be packaged together, eventually leading to security incidents.
Container
The running image file is the container. From the outside, it is an application and can provide services to the outside world.
So it is not difficult to find that the life cycle of a docker container is the process of generating, running and stopping an image file.
Recommended tutorial:docker tutorial
The above is the detailed content of There are several states of docker containers. For more information, please follow other related articles on the PHP Chinese website!