Skip to content

Commit

Permalink
ENGDOCS-2409 (#21963)
Browse files Browse the repository at this point in the history
<!--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
  • Loading branch information
aevesdocker authored Feb 6, 2025
1 parent 64917d1 commit 86b71d1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
22 changes: 22 additions & 0 deletions content/reference/compose-file/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,28 @@ the unused contexts.
Illustrative examples of how this is used in Buildx can be found
[here](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-additional-build-contexts---build-context).

`additional_contexts` can also refer to an image built by another service.
This allows a service image to be built using another service image as a base image, and to share
layers between service images.

```yaml
services:
base:
build:
context: .
dockerfile_inline: |
FROM alpine
RUN ...
base:
build:
context: .
dockerfile_inline: |
FROM base # image built for service base
RUN ...
additional_contexts:
base: service:base
```

### `args`

`args` define build arguments, that is Dockerfile `ARG` values.
Expand Down
4 changes: 2 additions & 2 deletions content/reference/compose-file/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ While these types are modeled in a Compose file as a sequence, they have special
| Attribute | Unique key |
|-------------|--------------------------|
| volumes | target |
| secrets | source |
| configs | source |
| secrets | target |
| configs | target |
| ports | {ip, target, published, protocol} |

When merging Compose files, Compose appends new entries that do not violate a uniqueness constraint and merge entries that share a unique key.
Expand Down
23 changes: 23 additions & 0 deletions content/reference/compose-file/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,29 @@ configuration, which means for Linux `/etc/hosts` get extra lines:
::1 myhostv6
```

### `gpus`

{{< summary-bar feature_name="Compose gpus" >}}

`gpus` specifies GPU devices to be allocated for container usage. This is equivalent to a [device request](deploy.md#devices) with
an implicit `gpu` capability.

```yaml
services:
model:
gpus:
- driver: 3dfx
count: 2
```

`gpus` also can be set as string `all` to allocate all available GPU devices to the container.

```yaml
services:
model:
gpus: all
```

### `group_add`

`group_add` specifies additional groups, by name or number, which the user inside the container must be a member of.
Expand Down
2 changes: 2 additions & 0 deletions data/summary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Compose file watch:
requires: Docker Compose [2.22.0](/manuals/compose/releases/release-notes.md#2220) and later
Compose format:
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
Compose gpus:
requires: Docker Compose [2.30.0](/manuals/compose/releases/release-notes.md#2300) and later
Compose include:
requires: Docker Compose [2.20.3](/manuals/compose/releases/release-notes.md#2203) and later
Compose label file:
Expand Down

0 comments on commit 86b71d1

Please sign in to comment.