Skip to content

Commit 86b71d1

Browse files
authored
ENGDOCS-2409 (#21963)
<!--Delete sections as needed --> ## Description Spec updates: Adds compose-spec/compose-spec#563 Adds compose-spec/compose-spec#558 Adds compose-spec/compose-spec#565 ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review
1 parent 64917d1 commit 86b71d1

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

content/reference/compose-file/build.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,28 @@ the unused contexts.
118118
Illustrative examples of how this is used in Buildx can be found
119119
[here](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-additional-build-contexts---build-context).
120120

121+
`additional_contexts` can also refer to an image built by another service.
122+
This allows a service image to be built using another service image as a base image, and to share
123+
layers between service images.
124+
125+
```yaml
126+
services:
127+
base:
128+
build:
129+
context: .
130+
dockerfile_inline: |
131+
FROM alpine
132+
RUN ...
133+
base:
134+
build:
135+
context: .
136+
dockerfile_inline: |
137+
FROM base # image built for service base
138+
RUN ...
139+
additional_contexts:
140+
base: service:base
141+
```
142+
121143
### `args`
122144

123145
`args` define build arguments, that is Dockerfile `ARG` values.

content/reference/compose-file/merge.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ While these types are modeled in a Compose file as a sequence, they have special
107107
| Attribute | Unique key |
108108
|-------------|--------------------------|
109109
| volumes | target |
110-
| secrets | source |
111-
| configs | source |
110+
| secrets | target |
111+
| configs | target |
112112
| ports | {ip, target, published, protocol} |
113113

114114
When merging Compose files, Compose appends new entries that do not violate a uniqueness constraint and merge entries that share a unique key.

content/reference/compose-file/services.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,29 @@ configuration, which means for Linux `/etc/hosts` get extra lines:
10051005
::1 myhostv6
10061006
```
10071007

1008+
### `gpus`
1009+
1010+
{{< summary-bar feature_name="Compose gpus" >}}
1011+
1012+
`gpus` specifies GPU devices to be allocated for container usage. This is equivalent to a [device request](deploy.md#devices) with
1013+
an implicit `gpu` capability.
1014+
1015+
```yaml
1016+
services:
1017+
model:
1018+
gpus:
1019+
- driver: 3dfx
1020+
count: 2
1021+
```
1022+
1023+
`gpus` also can be set as string `all` to allocate all available GPU devices to the container.
1024+
1025+
```yaml
1026+
services:
1027+
model:
1028+
gpus: all
1029+
```
1030+
10081031
### `group_add`
10091032

10101033
`group_add` specifies additional groups, by name or number, which the user inside the container must be a member of.

data/summary.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Compose file watch:
8181
requires: Docker Compose [2.22.0](/manuals/compose/releases/release-notes.md#2220) and later
8282
Compose format:
8383
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
84+
Compose gpus:
85+
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
8486
Compose include:
8587
requires: Docker Compose [2.20.3](/manuals/compose/releases/release-notes.md#2203) and later
8688
Compose label file:

0 commit comments

Comments
 (0)