Adding documentation for restart policy (#2912)

Resolves #1353
This commit is contained in:
Suraj Narwade
2017-04-20 03:35:02 +05:30
committed by Victoria Bialas
parent f4376652ea
commit be37ddd557
2 changed files with 18 additions and 5 deletions

View File

@@ -902,7 +902,15 @@ then read-write will be used.
> - container_name
> - container_name:rw
### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, mem\_swappiness, mem\_reservation, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir
### restart
`no` is the default restart policy, and it will not restart a container under any circumstance. When `always` is specified, the container always restarts. The `on-failure` policy restarts a container if the exit code indicates an on-failure error.
- restart: no
- restart: always
- restart: on-failure
### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, mem\_swappiness, mem\_reservation, oom_score_adj, privileged, read\_only, shm\_size, stdin\_open, tty, user, working\_dir
Each of these is a single value, analogous to its
[docker run](/engine/reference/run.md) counterpart.
@@ -926,8 +934,6 @@ Each of these is a single value, analogous to its
oom_score_adj: 500
restart: always
read_only: true
shm_size: 64M
stdin_open: true

View File

@@ -1210,12 +1210,20 @@ volumes:
target: /opt/app/static
```
### restart
`no` is the default restart policy, and it will not restart a container under any circumstance. When `always` is specified, the container always restarts. The `on-failure` policy restarts a container if the exit code indicates an on-failure error.
- restart: no
- restart: always
- restart: on-failure
> **Note:** The long syntax is new in v3.2
See [Docker Volumes](/engine/userguide/dockervolumes.md) and
[Volume Plugins](/engine/extend/plugins_volume.md) for more information.
### domainname, hostname, ipc, mac\_address, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir
### domainname, hostname, ipc, mac\_address, privileged, read\_only, shm\_size, stdin\_open, tty, user, working\_dir
Each of these is a single value, analogous to its
[docker run](/engine/reference/run.md) counterpart.
@@ -1230,7 +1238,6 @@ Each of these is a single value, analogous to its
privileged: true
restart: always
read_only: true
shm_size: 64M