Skip to content

Commit 91c81cd

Browse files
authored
Merge pull request #22981 from aevesdocker/ENGDOCS-2805
Compose freshness: gpu, production, multiple files, oci artifacts
1 parent 30df4d2 commit 91c81cd

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

content/manuals/compose/how-tos/gpu-support.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
description: Understand GPU support in Docker Compose
2+
description: Learn how to configure Docker Compose to use NVIDIA GPUs with CUDA-based containers
33
keywords: documentation, docs, docker, compose, GPU access, NVIDIA, samples
4-
title: Enable GPU access with Docker Compose
4+
title: Run Docker Compose services with GPU access
55
linkTitle: Enable GPU support
66
weight: 90
77
aliases:
@@ -19,16 +19,18 @@ GPUs are referenced in a `compose.yaml` file using the [device](/reference/compo
1919

2020
This provides more granular control over a GPU reservation as custom values can be set for the following device properties:
2121

22-
- `capabilities`. This value specifies as a list of strings (eg. `capabilities: [gpu]`). You must set this field in the Compose file. Otherwise, it returns an error on service deployment.
23-
- `count`. This value, specified as an integer or the value `all`, represents the number of GPU devices that should be reserved (providing the host holds that number of GPUs). If `count` is set to `all` or not specified, all GPUs available on the host are used by default.
22+
- `capabilities`. This value is specified as a list of strings. For example, `capabilities: [gpu]`. You must set this field in the Compose file. Otherwise, it returns an error on service deployment.
23+
- `count`. Specified as an integer or the value `all`, represents the number of GPU devices that should be reserved (providing the host holds that number of GPUs). If `count` is set to `all` or not specified, all GPUs available on the host are used by default.
2424
- `device_ids`. This value, specified as a list of strings, represents GPU device IDs from the host. You can find the device ID in the output of `nvidia-smi` on the host. If no `device_ids` are set, all GPUs available on the host are used by default.
25-
- `driver`. This value is specified as a string, for example `driver: 'nvidia'`
25+
- `driver`. Specified as a string, for example `driver: 'nvidia'`
2626
- `options`. Key-value pairs representing driver specific options.
2727

2828

2929
> [!IMPORTANT]
3030
>
3131
> You must set the `capabilities` field. Otherwise, it returns an error on service deployment.
32+
33+
> [!NOTE]
3234
>
3335
> `count` and `device_ids` are mutually exclusive. You must only define one field at a time.
3436

content/manuals/compose/how-tos/multiple-compose-files/extends.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
description: How to use Docker Compose's extends keyword to share configuration between
3-
files and projects
4-
keywords: fig, composition, compose, docker, orchestration, documentation, docs
2+
description: Learn how to reuse service configurations across files and projects using Docker Compose’s extends attribute.
3+
keywords: fig, composition, compose, docker, orchestration, documentation, docs, compose file modularization
54
title: Extend your Compose file
65
linkTitle: Extend
76
weight: 20
@@ -29,7 +28,7 @@ configuration. Tracking which fragment of a service is relative to which path is
2928
difficult and confusing, so to keep paths easier to understand, all paths must
3029
be defined relative to the base file.
3130

32-
## How it works
31+
## How the `extends` attribute works
3332

3433
### Extending services from another file
3534

@@ -62,7 +61,7 @@ You get exactly the same result as if you wrote
6261
`compose.yaml` with the same `build`, `ports`, and `volumes` configuration
6362
values defined directly under `web`.
6463

65-
To include the service `webapp` in the final project when extending services from another file, you need to explicitly include both services in your current Compose file. For example (note this is a non-normative example):
64+
To include the service `webapp` in the final project when extending services from another file, you need to explicitly include both services in your current Compose file. For example (this is for illustrative purposes only):
6665

6766
```yaml
6867
services:

content/manuals/compose/how-tos/multiple-compose-files/include.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Once the included Compose application loads, all resources are copied into the c
1818

1919
> [!NOTE]
2020
>
21-
> `include` applies recursively so an included Compose file which declares its own `include` section, results in those other files being included as well.
21+
> `include` applies recursively so an included Compose file which declares its own `include` section, causes those files to also be included.
2222
2323
## Example
2424

@@ -48,11 +48,12 @@ services:
4848
`include` allows you to reference Compose files from remote sources, such as OCI artifacts or Git repositories.
4949
Here `serviceB` is defined in a Compose file stored on Docker Hub.
5050

51-
## Include and overrides
51+
## Using overrides with included Compose files
5252

5353
Compose reports an error if any resource from `include` conflicts with resources from the included Compose file. This rule prevents
54-
unexpected conflicts with resources defined by the included compose file author. However, there may be some circumstances where you might want to tweak the
54+
unexpected conflicts with resources defined by the included compose file author. However, there may be some circumstances where you might want to customize the
5555
included model. This can be achieved by adding an override file to the include directive:
56+
5657
```yaml
5758
include:
5859
- path :
@@ -61,7 +62,7 @@ include:
6162
```
6263

6364
The main limitation with this approach is that you need to maintain a dedicated override file per include. For complex projects with multiple
64-
includes this would result into many Compose files.
65+
includes this would result in many Compose files.
6566

6667
The other option is to use a `compose.override.yaml` file. While conflicts will be rejected from the file using `include` when same
6768
resource is declared, a global Compose override file can override the resulting merged model, as demonstrated in following example:

content/manuals/compose/how-tos/oci-artifact.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Using Docker Compose with OCI artifacts
2+
title: Package and deploy Docker Compose applications as OCI artifacts
33
linkTitle: OCI artifact applications
44
weight: 110
5-
description: How to publish and start Compose applications as OCI artifacts
6-
keywords: cli, compose, oci, docker hub, artificats, publish, package, distribute
5+
description: Learn how to package, publish, and securely run Docker Compose applications from OCI-compliant registries.
6+
keywords: cli, compose, oci, docker hub, artificats, publish, package, distribute, docker compose oci support
77
params:
88
sidebar:
99
badge:
@@ -18,7 +18,7 @@ Docker Compose supports working with [OCI artifacts](/manuals/docker-hub/repos/m
1818
## Publish your Compose application as an OCI artifact
1919

2020
To distribute your Compose application as an OCI artifact, you can use the `docker compose publish` command, to publish it to an OCI-compliant registry.
21-
This allows others to deploy your application directly from the registry.
21+
This allows others to then deploy your application directly from the registry.
2222

2323
The publish function supports most of the composition capabilities of Compose, like overrides, extends or include, [with some limitations](#limitations).
2424

@@ -84,12 +84,12 @@ Are you ok to publish these environment variables? [y/N]:
8484

8585
If you decline, the publish process stops without sending anything to the registry.
8686

87-
### Limitations
87+
## Limitations
8888

89-
There is limitations to publishing Compose applications as OCI artifacts. You can't publish a Compose configuration:
89+
There are limitations to publishing Compose applications as OCI artifacts. You can't publish a Compose configuration:
9090
- With service(s) containing bind mounts
9191
- With service(s) containing only a `build` section
92-
- That includes local files with the `include` attribute. To publish successfully, ensure that any included local files are also published. You can then `include` to reference these files as remote `include` is supported.
92+
- That includes local files with the `include` attribute. To publish successfully, ensure that any included local files are also published. You can then use `include` to reference these files as remote `include` is supported.
9393

9494
## Start an OCI artifact application
9595

@@ -147,3 +147,9 @@ The `docker compose publish` command supports non-interactive execution, letting
147147
```console
148148
$ docker compose publish -y username/my-compose-app:latest
149149
```
150+
151+
## Next steps
152+
153+
- [Learn about OCI artifacts in Docker Hub](/manuals/docker-hub/repos/manage/hub-images/oci-artifacts.md)
154+
- [Compose publish command](/reference/cli/docker/compose/publish.md)
155+
- [Understand `include`](/reference/compose-file/include.md)

content/manuals/compose/how-tos/production.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Guide to using Docker Compose in production
3-
keywords: compose, orchestration, containers, production
2+
description: Learn how to configure, deploy, and update Docker Compose applications for production environments.
3+
keywords: compose, orchestration, containers, production, production docker compose configuration
44
title: Use Compose in production
55
weight: 100
66
aliases:
@@ -29,8 +29,8 @@ production. These changes might include:
2929
- Adding extra services such as a log aggregator
3030

3131
For this reason, consider defining an additional Compose file, for example
32-
`compose.production.yaml`, which specifies production-appropriate
33-
configuration. This configuration file only needs to include the changes you want to make from the original Compose file. The additional Compose file
32+
`compose.production.yaml`, with production-specific
33+
configuration details. This configuration file only needs to include the changes you want to make from the original Compose file. The additional Compose file
3434
is then applied over the original `compose.yaml` to create a new configuration.
3535

3636
Once you have a second configuration file, you can use it with the
@@ -55,7 +55,7 @@ $ docker compose up --no-deps -d web
5555

5656
This first command rebuilds the image for `web` and then stops, destroys, and recreates
5757
just the `web` service. The `--no-deps` flag prevents Compose from also
58-
recreating any services which `web` depends on.
58+
recreating any services that `web` depends on.
5959

6060
### Running Compose on a single server
6161

@@ -65,3 +65,8 @@ appropriately. For more information, see [pre-defined environment variables](env
6565

6666
Once you've set up your environment variables, all the normal `docker compose`
6767
commands work with no further configuration.
68+
69+
## Next steps
70+
71+
- [Using multiple Compose files](multiple-compose-files/_index.md)
72+

0 commit comments

Comments
 (0)