Before Docker 1.2, when a container exited for any reason or the Docker host was rebooted, the container had to be manually restarted using the restart command. With the release of Docker 1.2, a policy-based restart capability was added to the Docker engine to automate restarting containers. This feature is activated using the --restart option of the run command and it supports container restart at Docker host boot time, as well as when container failures occur.
Setting the restart policy on a container
Getting ready
Ensure that the Docker daemon is running on the host and can be connected through the Docker client.