mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update docs based on feedback from review for --restart
Signed-off-by: Michael Crosby <michael@docker.com>
This commit is contained in:
parent
860c13b788
commit
617edd89f4
2 changed files with 9 additions and 8 deletions
|
@ -30,6 +30,7 @@ docker-run - Run a command in a new container
|
||||||
[**-P**|**--publish-all**[=*false*]]
|
[**-P**|**--publish-all**[=*false*]]
|
||||||
[**-p**|**--publish**[=*[]*]]
|
[**-p**|**--publish**[=*[]*]]
|
||||||
[**--privileged**[=*false*]]
|
[**--privileged**[=*false*]]
|
||||||
|
[**--restart**[=*POLICY*]]
|
||||||
[**--rm**[=*false*]]
|
[**--rm**[=*false*]]
|
||||||
[**--sig-proxy**[=*true*]]
|
[**--sig-proxy**[=*true*]]
|
||||||
[**-t**|**--tty**[=*false*]]
|
[**-t**|**--tty**[=*false*]]
|
||||||
|
|
|
@ -1223,7 +1223,7 @@ application change:
|
||||||
|
|
||||||
#### Restart Policies
|
#### Restart Policies
|
||||||
|
|
||||||
Using the `--restart` flag on docker run you can specify a restart policy for
|
Using the `--restart` flag on Docker run you can specify a restart policy for
|
||||||
how a container should or should not be restarted on exit.
|
how a container should or should not be restarted on exit.
|
||||||
|
|
||||||
** no ** - Do not restart the container when it exits.
|
** no ** - Do not restart the container when it exits.
|
||||||
|
@ -1232,19 +1232,19 @@ how a container should or should not be restarted on exit.
|
||||||
|
|
||||||
** always ** - Always restart the container reguardless of the exit status.
|
** always ** - Always restart the container reguardless of the exit status.
|
||||||
|
|
||||||
You can also specify the maximum amount of times docker will try to restart the
|
You can also specify the maximum amount of times Docker will try to restart the
|
||||||
container when using the ** on-failure ** policy. The default is that docker will try forever to restart the container.
|
container when using the ** on-failure ** policy. The default is that Docker will try forever to restart the container.
|
||||||
|
|
||||||
$ sudo docker run --restart=always redis
|
$ sudo docker run --restart=always redis
|
||||||
|
|
||||||
This will run the redis container with a restart policy of ** always ** so that if
|
This will run the `redis` container with a restart policy of ** always ** so that if
|
||||||
the container exits, docker will restart it.
|
the container exits, Docker will restart it.
|
||||||
|
|
||||||
$ sudo docker run --restart=on-failure:10 redis
|
$ sudo docker run --restart=on-failure:10 redis
|
||||||
|
|
||||||
This will run the redis container with a restart policy of ** on-failure ** and a
|
This will run the `redis` container with a restart policy of ** on-failure ** and a
|
||||||
maximum restart count of 10. If the redis container exits with a non-zero exit
|
maximum restart count of 10. If the `redis` container exits with a non-zero exit
|
||||||
status more than 10 times in a row docker will abort trying to restart the container.
|
status more than 10 times in a row Docker will abort trying to restart the container.
|
||||||
|
|
||||||
## save
|
## save
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue