mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
committed by
Victoria Bialas
parent
f4376652ea
commit
be37ddd557
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user