update docker compose
This commit is contained in:
parent
ae575e903b
commit
5ef2091f51
1 changed files with 25 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
obj: application
|
||||
source: https://docs.docker.com/compose
|
||||
repo: https://github.com/docker/compose
|
||||
rev: 2024-07-15
|
||||
---
|
||||
|
||||
# Docker Compose
|
||||
|
@ -420,7 +421,8 @@ constraints
|
|||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- disktype=ssd
|
||||
- node.labels.disk == ssd
|
||||
- node.role == manager
|
||||
```
|
||||
|
||||
```yaml
|
||||
|
@ -444,4 +446,25 @@ deploy:
|
|||
placement:
|
||||
preferences:
|
||||
datacenter: us-east
|
||||
```
|
||||
```
|
||||
|
||||
### `resources`
|
||||
`resources` configures physical resource constraints for container to run on platform. Those constraints can be configured as:
|
||||
- `limits`: The platform must prevent the container to allocate more.
|
||||
- `reservations`: The platform must guarantee the container can allocate at least the configured amount.
|
||||
|
||||
The following can be configured:
|
||||
- `cpus`: `cpus` configures a limit or reservation for how much of the available CPU resources, as number of cores, a container can use.
|
||||
- `memory`: `memory` configures a limit or reservation on the amount of memory a container can allocate, set as a string expressing a byte value.
|
||||
- `pids`: `pids` tunes a container’s PIDs limit, set as an integer.
|
||||
|
||||
```yml
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: 0.5
|
||||
memory: 128MiB
|
||||
reservations:
|
||||
cpus: 0.3
|
||||
memory: 64MiB
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue