Running Docker Containers
Best practices for building containers and microservices architecture dictate that a container should only run a single process. Keeping this principle in mind, we can design containers that are easy to build, troubleshoot, scale, and deploy.
The life cycle of a container is defined by the state of the container and the running processes within it. A container can be in a running or stopped state based on actions taken by the operator, the container orchestrator, or the state of the application running inside the container itself. For example, an operator can manually stop or start a container using the docker stop
or docker start
command-line interface (CLI) interface commands. Docker itself may automatically stop or restart a container if it detects that the container has entered an unhealthy state. Furthermore, if the primary application running inside the container fails or stops, the running container instance should also stop. Many container runtime...