There are cases where software fails in rare conditions that are temporary in nature. Although it’s important to be made aware when these conditions arise, it’s usually at least as important to restore the service as quickly as possible.
When all the processes in a container have exited, that container will enter the exited state. A Docker container can be in one of four states:
A basic strategy for recovering from temporary failures is that when a process exits or fails, it will automatically restart. Docker provides some options for monitoring and restarting containers.
#docker