From 32c786079d96063145f2190b61cbb8b87970ceca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lio=E6=9D=8E=E6=AD=90?= Date: Thu, 8 May 2025 00:40:11 -0700 Subject: [PATCH 1/3] Update model-runner.md: replace hyphens (#22603) ## Description This makes the resulting env vars `AI_RUNNER_URL` and `AI_RUNNER_MODEL` actually accessible in different languages. ## Reviews - [ ] Technical review - [ ] Editorial review - [ ] Product review --- content/manuals/compose/how-tos/model-runner.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/manuals/compose/how-tos/model-runner.md b/content/manuals/compose/how-tos/model-runner.md index 36d27b2b7eba..2a7fca43ca83 100644 --- a/content/manuals/compose/how-tos/model-runner.md +++ b/content/manuals/compose/how-tos/model-runner.md @@ -33,21 +33,21 @@ services: chat: image: my-chat-app depends_on: - - ai-runner + - ai_runner - ai-runner: + ai_runner: provider: type: model options: model: ai/smollm2 ``` -Notice the dedicated `provider` attribute in the `ai-runner` service. +Notice the dedicated `provider` attribute in the `ai_runner` service. 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. There is also a `depends_on` attribute in the `chat` service. -This attribute specifies that the `chat` service depends on the `ai-runner` service. -This means that the `ai-runner` service will be started before the `chat` service to allow injection of model information to the `chat` service. +This attribute specifies that the `chat` service depends on the `ai_runner` service. +This means that the `ai_runner` service will be started before the `chat` service to allow injection of model information to the `chat` service. ## How it works @@ -56,8 +56,8 @@ It also sends Compose the model tag name and the URL to access the model runner. This information is then passed to services which declare a dependency on the model provider. In the example above, the `chat` service receives 2 environment variables prefixed by the service name: - - `AI-RUNNER_URL` with the URL to access the model runner - - `AI-RUNNER_MODEL` with the model name which could be passed with the URL to request the model. + - `AI_RUNNER_URL` with the URL to access the model runner + - `AI_RUNNER_MODEL` with the model name which could be passed with the URL to request the model. This lets the `chat` service to interact with the model and use it for its own purposes. From 751d6681cc9e5599389d266825dda94690c6a78f Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Thu, 8 May 2025 09:56:01 +0200 Subject: [PATCH 2/3] release-notes for Compose v2.36.0 version (#22600) ## Description Add release notes for Compose version `v2.36.0` ## Related issues or tickets https://docker.atlassian.net/browse/APCLI-1117 ## Reviews - [ ] Technical review - [x] Editorial review - [ ] Product review Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> --- .../v2/docs/reference/compose_build.md | 1 + .../v2/docs/reference/compose_config.md | 2 +- .../docs/reference/docker_compose_build.yaml | 10 ++++++++++ .../docs/reference/docker_compose_config.yaml | 1 - _vendor/modules.txt | 6 +++--- .../manuals/compose/releases/release-notes.md | 19 +++++++++++++++++++ go.mod | 8 ++++---- go.sum | 2 ++ hugo.yaml | 2 +- 9 files changed, 41 insertions(+), 10 deletions(-) diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md index 98d573e44c38..5589a46934c6 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md +++ b/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md @@ -17,6 +17,7 @@ run `docker compose build` to rebuild it. |:----------------------|:--------------|:--------|:------------------------------------------------------------------------------------------------------------| | `--build-arg` | `stringArray` | | Set build-time variables for services | | `--builder` | `string` | | Set builder to use | +| `--check` | `bool` | | Check build configuration | | `--dry-run` | `bool` | | Execute command in dry run mode | | `-m`, `--memory` | `bytes` | `0` | Set memory limit for the build container. Not supported by BuildKit. | | `--no-cache` | `bool` | | Do not use cache when building the image | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md index 9e87efd29cbc..78c1835a5278 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md +++ b/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md @@ -15,7 +15,7 @@ the canonical format. |:--------------------------|:---------|:--------|:----------------------------------------------------------------------------| | `--dry-run` | `bool` | | Execute command in dry run mode | | `--environment` | `bool` | | Print environment used for interpolation. | -| `--format` | `string` | `yaml` | Format the output. Values: [yaml \| json] | +| `--format` | `string` | | Format the output. Values: [yaml \| json] | | `--hash` | `string` | | Print the service config hash, one per line. | | `--images` | `bool` | | Print the image names, one per line. | | `--no-consistency` | `bool` | | Don't check model consistency - warning: may produce invalid Compose output | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml index 3f53dcf73628..1197d5314c47 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml +++ b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml @@ -33,6 +33,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: check + value_type: bool + default_value: "false" + description: Check build configuration + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: compress value_type: bool default_value: "true" diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml index 15b1e7dc3989..7ec479b2000b 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml +++ b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml @@ -21,7 +21,6 @@ options: swarm: false - option: format value_type: string - default_value: yaml description: 'Format the output. Values: [yaml | json]' deprecated: false hidden: false diff --git a/_vendor/modules.txt b/_vendor/modules.txt index ca334bf0d1a8..1a4ad2197dfa 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/moby/moby v28.1.0-rc.2+incompatible -# github.com/moby/buildkit v0.21.0 +# github.com/moby/buildkit v0.21.1 # github.com/docker/buildx v0.23.0 -# github.com/docker/cli v28.1.0+incompatible -# github.com/docker/compose/v2 v2.35.1 +# github.com/docker/cli v28.1.1+incompatible +# github.com/docker/compose/v2 v2.36.0 # github.com/docker/scout-cli v1.15.0 diff --git a/content/manuals/compose/releases/release-notes.md b/content/manuals/compose/releases/release-notes.md index b90bed1afe75..a37c97ff2048 100644 --- a/content/manuals/compose/releases/release-notes.md +++ b/content/manuals/compose/releases/release-notes.md @@ -13,6 +13,25 @@ aliases: For more detailed information, see the [release notes in the Compose repo](https://github.com/docker/compose/releases/). +## 2.36.0 + +{{< release-date date="2025-05-07" >}} + +### Bug fixes and enhancements + +- Introduced `networks.interface_name` +- Added support for `COMPOSE_PROGRESS` env variable +- Added `service.provider` to external binaries +- Introduced build `--check` flag +- Fixed multiple panic issues when parsing Compose files + +### Update + +- Dependencies upgrade: bump compose-go to v2.6.2 +- Dependencies upgrade: bump docker engine and cli to v28.1.0 +- Dependencies upgrade: bump containerd to 2.0.5 +- Dependencies upgrade: bump buildkit to v0.21.1 + ## 2.35.1 {{< release-date date="2025-04-17" >}} diff --git a/go.mod b/go.mod index 155f635ef101..26a9c60f1984 100644 --- a/go.mod +++ b/go.mod @@ -6,17 +6,17 @@ toolchain go1.24.1 require ( github.com/docker/buildx v0.23.0 // indirect - github.com/docker/cli v28.1.0+incompatible // indirect - github.com/docker/compose/v2 v2.35.1 // indirect + github.com/docker/cli v28.1.1+incompatible // indirect + github.com/docker/compose/v2 v2.36.0 // indirect github.com/docker/scout-cli v1.15.0 // indirect - github.com/moby/buildkit v0.21.0 // indirect + github.com/moby/buildkit v0.21.1 // indirect github.com/moby/moby v28.1.0-rc.2+incompatible // indirect ) replace ( github.com/docker/buildx => github.com/docker/buildx v0.23.0 github.com/docker/cli => github.com/docker/cli v28.1.0-rc.2+incompatible - github.com/docker/compose/v2 => github.com/docker/compose/v2 v2.35.1 + github.com/docker/compose/v2 => github.com/docker/compose/v2 v2.36.0 github.com/docker/scout-cli => github.com/docker/scout-cli v1.15.0 github.com/moby/buildkit => github.com/moby/buildkit v0.20.0 github.com/moby/moby => github.com/moby/moby v28.1.0-rc.2+incompatible diff --git a/go.sum b/go.sum index e0d9918a4407..8e4053f2ce26 100644 --- a/go.sum +++ b/go.sum @@ -231,6 +231,8 @@ github.com/docker/compose/v2 v2.35.0 h1:bU23OeFrbGyHYrKijMSEwkOeDg2TLhAGntU2F3hw github.com/docker/compose/v2 v2.35.0/go.mod h1:S5ejUILn9KTYC6noX3IxznWu3/sb3FxdZqIYbq4seAk= github.com/docker/compose/v2 v2.35.1 h1:oRt5EE22een6DEAkNNQcuzJGhBS2rcMtEKdbfMhFIgk= github.com/docker/compose/v2 v2.35.1/go.mod h1:Ydd9ceg7VBOPSVAsDDKfyGGAkjejH3cD91GSmHjuRhI= +github.com/docker/compose/v2 v2.36.0 h1:MACSfQ2xqcwgCwAtsHVoQkFbHi2nNfNAsd5EWFg164k= +github.com/docker/compose/v2 v2.36.0/go.mod h1:kFPppTinl2Q0Lv3Dy9titIL41oWYoUkNxoKQZb/lfSU= github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= diff --git a/hugo.yaml b/hugo.yaml index 3250af12955a..fb1c962215aa 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -140,7 +140,7 @@ params: # (Used to show e.g., "latest" and "latest"-1 in engine install examples docker_ce_version_prev: "28.1.0" # Latest Docker Compose version - compose_version: "v2.35.1" + compose_version: "v2.36.0" # Latest BuildKit version buildkit_version: "0.21.0" From f6bb42e96de38c4861b85cd1f3e6be7fc1930819 Mon Sep 17 00:00:00 2001 From: Guillaume Lours <705411+glours@users.noreply.github.com> Date: Thu, 8 May 2025 10:02:08 +0200 Subject: [PATCH 3/3] add how-to page explaining usage of Compose provider services (#22586) ## Description Add how-to page for Compose provider services explaining usage and configuration of this new feature allowing extending Compose behaviour ## Related issues or tickets https://docker.atlassian.net/browse/APCLI-1091 ## Reviews - [x] Technical review - [x] Editorial review - [ ] Product review --------- Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com> Co-authored-by: Nicolas De loof Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com> --- .../compose/how-tos/provider-services.md | 125 ++++++++++++++++++ data/summary.yaml | 2 + 2 files changed, 127 insertions(+) create mode 100644 content/manuals/compose/how-tos/provider-services.md diff --git a/content/manuals/compose/how-tos/provider-services.md b/content/manuals/compose/how-tos/provider-services.md new file mode 100644 index 000000000000..fa1ddbb3dad7 --- /dev/null +++ b/content/manuals/compose/how-tos/provider-services.md @@ -0,0 +1,125 @@ +--- +title: Use provider services +description: Learn how to use provider services in Docker Compose to integrate external capabilities into your applications +keywords: compose, docker compose, provider, services, platform capabilities, integration, model runner, ai +weight: 112 +params: + sidebar: + badge: + color: green + text: New +--- + +{{< summary-bar feature_name="Compose provider services" >}} + +Docker Compose supports provider services, which allow integration with services whose lifecycles are managed by third-party components rather than by Compose itself. +This feature enables you to define and utilize platform-specific services without the need for manual setup or direct lifecycle management. + + +## What are provider services? + +Provider services are a special type of service in Compose that represents platform capabilities rather than containers. +They allow you to declare dependencies on specific platform features that your application needs. + +When you define a provider service in your Compose file, Compose works with the platform to provision and configure +the requested capability, making it available to your application services. + +## Using provider services + +To use a provider service in your Compose file, you need to: + +1. Define a service with the `provider` attribute +2. Specify the `type` of provider you want to use +3. Configure any provider-specific options +4. Declare dependencies from your application services to the provider service + +Here's a basic example: + +```yaml +services: + database: + provider: + type: awesomecloud + options: + type: mysql + foo: bar + app: + image: myapp + depends_on: + - database +``` + +Notice the dedicated `provider` attribute in the `database` service. +This attribute specifies that the service is managed by a provider and lets you define options specific to that provider type. + +The `depends_on` attribute in the `app` service specifies that it depends on the `database` service. +This means that the `database` service will be started before the `app` service, allowing the provider information +to be injected into the `app` service. + +## How it works + +During the `docker compose up` command execution, Compose identifies services relying on providers and works with them to provision +the requested capabilities. The provider then populates Compose model with information about how to access the provisioned resource. + +This information is passed to services that declare a dependency on the provider service, typically through environment +variables. The naming convention for these variables is: + +```env +<>_<> +``` + +For example, if your provider service is named `database`, your application service might receive environment variables like: + +- `DATABASE_URL` with the URL to access the provisioned resource +- `DATABASE_TOKEN` with an authentication token +- Other provider-specific variables + +Your application can then use these environment variables to interact with the provisioned resource. + +## Provider types + +The `type` field in a provider service references the name of either: + +1. A Docker CLI plugin (e.g., `docker-model`) +2. A binary available in the user's PATH + +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. + +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. + +```yaml +services: + ai-runner: + provider: + type: model # Looks for docker-model plugin or model binary + options: + model: ai/example-model +``` + +The plugin or binary is responsible for: + +1. Interpreting the options provided in the provider service +2. Provisioning the requested capability +3. Returning information about how to access the provisioned resource + +This information is then passed to dependent services as environment variables. + +## Benefits of using provider services + +Using provider services in your Compose applications offers several benefits: + +1. Simplified configuration: You don't need to manually configure and manage platform capabilities +2. Declarative approach: You can declare all your application's dependencies in one place +3. Consistent workflow: You use the same Compose commands to manage your entire application, including platform capabilities + +## Creating your own provider + +If you want to create your own provider to extend Compose with custom capabilities, you can implement a Compose plugin that registers provider types. + +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). +This guide explains the extension mechanism that allows you to add new provider types to Compose. + +## Reference + +- [Docker Model Runner documentation](/manuals/ai/model-runner.md) +- [Compose Extensions documentation](https://github.com/docker/compose/blob/main/docs/extension.md) \ No newline at end of file diff --git a/data/summary.yaml b/data/summary.yaml index 01f870c28e66..5246f3899d9f 100644 --- a/data/summary.yaml +++ b/data/summary.yaml @@ -109,6 +109,8 @@ Compose model runner: requires: Docker Compose [2.35.0](/manuals/compose/releases/release-notes.md#2300) and later, and Docker Desktop 4.41 and later Compose OCI artifact: requires: Docker Compose [2.34.0](/manuals/compose/releases/release-notes.md#2340) and later +Compose provider services: + requires: Docker Compose [2.36.0](/manuals/compose/releases/release-notes.md) and later Compose replace file: requires: Docker Compose [2.24.4](/manuals/compose/releases/release-notes.md#2244) and later Compose required: