Table of contents
Open Table of contents
How to Restart Docker Containers Automatically After a Server Reboot
For the relevant scenarios, see the official Docker guide Use the docker update command
docker update --restart=always container
To check whether the setting took effect, use the docker inspect command
docker inpsect --format='{{.HostConfig.RestartPolicy.Name}}' container
You can also specify the policy when you first create the Docker container; see the docker run command