Skip to content

Commit acde2dc

Browse files
aevesdockerlionellogloursndeloof
authored
publish updates from main (#22604)
Automated pull request for publishing docs updates. --------- Signed-off-by: Guillaume Lours <[email protected]> Co-authored-by: Lio李歐 <[email protected]> Co-authored-by: Guillaume Lours <[email protected]> Co-authored-by: Nicolas De loof <[email protected]> Co-authored-by: Allie Sadler <[email protected]>
2 parents 7e614c4 + f6bb42e commit acde2dc

File tree

12 files changed

+175
-17
lines changed

12 files changed

+175
-17
lines changed

_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_vendor/modules.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# github.com/moby/moby v28.1.0-rc.2+incompatible
2-
# github.com/moby/buildkit v0.21.0
2+
# github.com/moby/buildkit v0.21.1
33
# github.com/docker/buildx v0.23.0
4-
# github.com/docker/cli v28.1.0+incompatible
5-
# github.com/docker/compose/v2 v2.35.1
4+
# github.com/docker/cli v28.1.1+incompatible
5+
# github.com/docker/compose/v2 v2.36.0
66
# github.com/docker/scout-cli v1.15.0

content/manuals/compose/how-tos/model-runner.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ services:
3333
chat:
3434
image: my-chat-app
3535
depends_on:
36-
- ai-runner
36+
- ai_runner
3737

38-
ai-runner:
38+
ai_runner:
3939
provider:
4040
type: model
4141
options:
4242
model: ai/smollm2
4343
```
4444
45-
Notice the dedicated `provider` attribute in the `ai-runner` service.
45+
Notice the dedicated `provider` attribute in the `ai_runner` service.
4646
This attribute specifies that the service is a model provider and lets you define options such as the name of the model to be used.
4747

4848
There is also a `depends_on` attribute in the `chat` service.
49-
This attribute specifies that the `chat` service depends on the `ai-runner` service.
50-
This means that the `ai-runner` service will be started before the `chat` service to allow injection of model information to the `chat` service.
49+
This attribute specifies that the `chat` service depends on the `ai_runner` service.
50+
This means that the `ai_runner` service will be started before the `chat` service to allow injection of model information to the `chat` service.
5151

5252
## How it works
5353

@@ -56,8 +56,8 @@ It also sends Compose the model tag name and the URL to access the model runner.
5656

5757
This information is then passed to services which declare a dependency on the model provider.
5858
In the example above, the `chat` service receives 2 environment variables prefixed by the service name:
59-
- `AI-RUNNER_URL` with the URL to access the model runner
60-
- `AI-RUNNER_MODEL` with the model name which could be passed with the URL to request the model.
59+
- `AI_RUNNER_URL` with the URL to access the model runner
60+
- `AI_RUNNER_MODEL` with the model name which could be passed with the URL to request the model.
6161

6262
This lets the `chat` service to interact with the model and use it for its own purposes.
6363

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: Use provider services
3+
description: Learn how to use provider services in Docker Compose to integrate external capabilities into your applications
4+
keywords: compose, docker compose, provider, services, platform capabilities, integration, model runner, ai
5+
weight: 112
6+
params:
7+
sidebar:
8+
badge:
9+
color: green
10+
text: New
11+
---
12+
13+
{{< summary-bar feature_name="Compose provider services" >}}
14+
15+
Docker Compose supports provider services, which allow integration with services whose lifecycles are managed by third-party components rather than by Compose itself.
16+
This feature enables you to define and utilize platform-specific services without the need for manual setup or direct lifecycle management.
17+
18+
19+
## What are provider services?
20+
21+
Provider services are a special type of service in Compose that represents platform capabilities rather than containers.
22+
They allow you to declare dependencies on specific platform features that your application needs.
23+
24+
When you define a provider service in your Compose file, Compose works with the platform to provision and configure
25+
the requested capability, making it available to your application services.
26+
27+
## Using provider services
28+
29+
To use a provider service in your Compose file, you need to:
30+
31+
1. Define a service with the `provider` attribute
32+
2. Specify the `type` of provider you want to use
33+
3. Configure any provider-specific options
34+
4. Declare dependencies from your application services to the provider service
35+
36+
Here's a basic example:
37+
38+
```yaml
39+
services:
40+
database:
41+
provider:
42+
type: awesomecloud
43+
options:
44+
type: mysql
45+
foo: bar
46+
app:
47+
image: myapp
48+
depends_on:
49+
- database
50+
```
51+
52+
Notice the dedicated `provider` attribute in the `database` service.
53+
This attribute specifies that the service is managed by a provider and lets you define options specific to that provider type.
54+
55+
The `depends_on` attribute in the `app` service specifies that it depends on the `database` service.
56+
This means that the `database` service will be started before the `app` service, allowing the provider information
57+
to be injected into the `app` service.
58+
59+
## How it works
60+
61+
During the `docker compose up` command execution, Compose identifies services relying on providers and works with them to provision
62+
the requested capabilities. The provider then populates Compose model with information about how to access the provisioned resource.
63+
64+
This information is passed to services that declare a dependency on the provider service, typically through environment
65+
variables. The naming convention for these variables is:
66+
67+
```env
68+
<<PROVIDER_SERVICE_NAME>>_<<VARIABLE_NAME>>
69+
```
70+
71+
For example, if your provider service is named `database`, your application service might receive environment variables like:
72+
73+
- `DATABASE_URL` with the URL to access the provisioned resource
74+
- `DATABASE_TOKEN` with an authentication token
75+
- Other provider-specific variables
76+
77+
Your application can then use these environment variables to interact with the provisioned resource.
78+
79+
## Provider types
80+
81+
The `type` field in a provider service references the name of either:
82+
83+
1. A Docker CLI plugin (e.g., `docker-model`)
84+
2. A binary available in the user's PATH
85+
86+
When Compose encounters a provider service, it looks for a plugin or binary with the specified name to handle the provisioning of the requested capability.
87+
88+
For example, if you specify `type: model`, Compose will look for a Docker CLI plugin named `docker-model` or a binary named `model` in the PATH.
89+
90+
```yaml
91+
services:
92+
ai-runner:
93+
provider:
94+
type: model # Looks for docker-model plugin or model binary
95+
options:
96+
model: ai/example-model
97+
```
98+
99+
The plugin or binary is responsible for:
100+
101+
1. Interpreting the options provided in the provider service
102+
2. Provisioning the requested capability
103+
3. Returning information about how to access the provisioned resource
104+
105+
This information is then passed to dependent services as environment variables.
106+
107+
## Benefits of using provider services
108+
109+
Using provider services in your Compose applications offers several benefits:
110+
111+
1. Simplified configuration: You don't need to manually configure and manage platform capabilities
112+
2. Declarative approach: You can declare all your application's dependencies in one place
113+
3. Consistent workflow: You use the same Compose commands to manage your entire application, including platform capabilities
114+
115+
## Creating your own provider
116+
117+
If you want to create your own provider to extend Compose with custom capabilities, you can implement a Compose plugin that registers provider types.
118+
119+
For detailed information on how to create and implement your own provider, refer to the [Compose Extensions documentation](https://github.com/docker/compose/blob/main/docs/extension.md).
120+
This guide explains the extension mechanism that allows you to add new provider types to Compose.
121+
122+
## Reference
123+
124+
- [Docker Model Runner documentation](/manuals/ai/model-runner.md)
125+
- [Compose Extensions documentation](https://github.com/docker/compose/blob/main/docs/extension.md)

content/manuals/compose/releases/release-notes.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ aliases:
1313

1414
For more detailed information, see the [release notes in the Compose repo](https://github.com/docker/compose/releases/).
1515

16+
## 2.36.0
17+
18+
{{< release-date date="2025-05-07" >}}
19+
20+
### Bug fixes and enhancements
21+
22+
- Introduced `networks.interface_name`
23+
- Added support for `COMPOSE_PROGRESS` env variable
24+
- Added `service.provider` to external binaries
25+
- Introduced build `--check` flag
26+
- Fixed multiple panic issues when parsing Compose files
27+
28+
### Update
29+
30+
- Dependencies upgrade: bump compose-go to v2.6.2
31+
- Dependencies upgrade: bump docker engine and cli to v28.1.0
32+
- Dependencies upgrade: bump containerd to 2.0.5
33+
- Dependencies upgrade: bump buildkit to v0.21.1
34+
1635
## 2.35.1
1736

1837
{{< release-date date="2025-04-17" >}}

data/summary.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Compose model runner:
109109
requires: Docker Compose [2.35.0](/manuals/compose/releases/release-notes.md#2300) and later, and Docker Desktop 4.41 and later
110110
Compose OCI artifact:
111111
requires: Docker Compose [2.34.0](/manuals/compose/releases/release-notes.md#2340) and later
112+
Compose provider services:
113+
requires: Docker Compose [2.36.0](/manuals/compose/releases/release-notes.md) and later
112114
Compose replace file:
113115
requires: Docker Compose [2.24.4](/manuals/compose/releases/release-notes.md#2244) and later
114116
Compose required:

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ toolchain go1.24.1
66

77
require (
88
github.com/docker/buildx v0.23.0 // indirect
9-
github.com/docker/cli v28.1.0+incompatible // indirect
10-
github.com/docker/compose/v2 v2.35.1 // indirect
9+
github.com/docker/cli v28.1.1+incompatible // indirect
10+
github.com/docker/compose/v2 v2.36.0 // indirect
1111
github.com/docker/scout-cli v1.15.0 // indirect
12-
github.com/moby/buildkit v0.21.0 // indirect
12+
github.com/moby/buildkit v0.21.1 // indirect
1313
github.com/moby/moby v28.1.0-rc.2+incompatible // indirect
1414
)
1515

1616
replace (
1717
github.com/docker/buildx => github.com/docker/buildx v0.23.0
1818
github.com/docker/cli => github.com/docker/cli v28.1.0-rc.2+incompatible
19-
github.com/docker/compose/v2 => github.com/docker/compose/v2 v2.35.1
19+
github.com/docker/compose/v2 => github.com/docker/compose/v2 v2.36.0
2020
github.com/docker/scout-cli => github.com/docker/scout-cli v1.15.0
2121
github.com/moby/buildkit => github.com/moby/buildkit v0.20.0
2222
github.com/moby/moby => github.com/moby/moby v28.1.0-rc.2+incompatible

0 commit comments

Comments
 (0)