March 2017
Beginner to intermediate
925 pages
18h 11m
English
Before Docker 1.2, there used to be an option to restart the container. With the release of Docker 1.2, it has been added with the run command with flags to specify the restart policy. With this policy, we can configure containers to start at boot time. This option is also very useful when a container dies accidentally.
Make sure the Docker daemon is running on the host and you can connect through the Docker client.
You can set the restart policy using the following syntax:
$ docker run --restart=POLICY [ OPTIONS ] IMAGE[:TAG] [COMMAND] [ARG...]
Here is an example of a command:
$ docker run --restart=always -d -i -t fedora /bin/bash
There are three restart policies to choose from: ...
Read now
Unlock full access