compose include - add an example using remote Compose file from an OCI artifact (#22950)

<!--Delete sections as needed -->

## Description
Add an example using including a Compose file from an OCI artifact
stored on Docker Hub

## Related issues or tickets
Fix #22881

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [ ] Technical review
- [x] Editorial review
- [ ] Product review

---------

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2025-07-01 09:51:25 +02:00 committed by GitHub
parent db51090388
commit 313a0aedd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -36,6 +36,18 @@ services:
This means the team managing `serviceB` can refactor its own database component to introduce additional services without impacting any dependent teams. It also means that the dependent teams don't need to include additional flags on each Compose command they run.
```yaml
include:
- oci://docker.io/username/my-compose-app:latest # use a Compose file stored as an OCI artifact
services:
serviceA:
build: .
depends_on:
- serviceB
```
`include` allows you to reference Compose files from remote sources, such as OCI artifacts or Git repositories.
Here `serviceB` is defined in a Compose file stored on Docker Hub.
## Include and overrides
Compose reports an error if any resource from `include` conflicts with resources from the included Compose file. This rule prevents