compose spec consistency (#20915)

* compose spec consistency

* fix links

* Update content/reference/compose-file/build.md

Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>

---------

Co-authored-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
Allie Sadler 2024-09-16 14:57:42 +01:00 committed by GitHub
parent 0d3955459e
commit 4021d76e8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 20 deletions

View File

@ -508,7 +508,12 @@ build:
``` ```
The image builder can then rely on this to mount the SSH key during build. The image builder can then rely on this to mount the SSH key during build.
For more information, see the [`RUN --mount=type=ssh` Dockerfile reference](/reference/dockerfile.md#run---mounttypessh).
For illustration, [SSH mounts](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/reference.md#run---mounttypessh) can be used to mount the SSH key set by ID and access a secured resource:
```console
RUN --mount=type=ssh,id=myproject git clone ...
```
### shm_size ### shm_size

View File

@ -66,8 +66,7 @@ services:
#### constraints #### constraints
`constraints` defines a required property the platform's node must fulfill to run the service container. It can be set either `constraints` defines a required property the platform's node must fulfill to run the service container. For a further example, see the [CLI reference docs](/reference/cli/docker/service/create.md#constraint).
by a list or a map with string values.
```yml ```yml
deploy: deploy:
@ -76,30 +75,16 @@ deploy:
- disktype=ssd - disktype=ssd
``` ```
```yml
deploy:
placement:
constraints:
disktype: ssd
```
#### preferences #### preferences
`preferences` defines a property the platform's node should fulfill to run service container. It can be set either `preferences` defines a strategy (currently `spread` is the only supported strategy) to spread tasks evenly
by a list or a map with string values. over the values of the datacenter node label. For a further example, see the [CLI reference docs](/reference/cli/docker/service/create.md#placement-pref)
```yml ```yml
deploy: deploy:
placement: placement:
preferences: preferences:
- datacenter=us-east - spread: node.labels.zone
```
```yml
deploy:
placement:
preferences:
datacenter: us-east
``` ```
### replicas ### replicas