Skip to content

Commit 1a01fdd

Browse files
publish updates from main (#22967)
Automated pull request for publishing docs updates. --------- Co-authored-by: Allie Sadler <[email protected]> Co-authored-by: Arthur <[email protected]>
2 parents 3a960f1 + a1774fe commit 1a01fdd

File tree

17 files changed

+273
-71
lines changed

17 files changed

+273
-71
lines changed

assets/css/global.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,9 @@ input[type="search"]::-ms-clear {
9595
.navbar-group:first-of-type {
9696
margin-top: 0.2rem !important;
9797
}
98+
99+
#search-page-results {
100+
mark:where(.dark, .dark *) {
101+
color: var(--color-blue-400);
102+
}
103+
}

assets/css/utilities.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,7 @@
253253
@utility chip {
254254
@apply border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-800 select-none dark:bg-gray-700 dark:text-gray-200;
255255
}
256+
257+
@utility pagination-link {
258+
@apply flex items-center justify-center rounded-sm p-2;
259+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
build:
3+
render: never
4+
title: AI and Docker Compose
5+
weight: 40
6+
params:
7+
sidebar:
8+
group: AI
9+
---
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
title: Define AI Models in Docker Compose applications
3+
linkTitle: Use AI models in Compose
4+
description: Learn how to define and use AI models in Docker Compose applications using the models top-level element
5+
keywords: compose, docker compose, models, ai, machine learning, cloud providers, specification
6+
weight: 10
7+
params:
8+
sidebar:
9+
badge:
10+
color: green
11+
text: New
12+
---
13+
14+
{{< summary-bar feature_name="Compose models" >}}
15+
16+
Compose lets you define AI models as core components of your application, so you can declare model dependencies alongside services and run the application on any platform that supports the Compose Specification.
17+
18+
## Prerequisites
19+
20+
- Docker Compose v2.38 or later
21+
- A platform that supports Compose models such as Docker Model Runner or compatible cloud providers
22+
23+
## What are Compose models?
24+
25+
Compose `models` are a standardized way to define AI model dependencies in your application. By using the []`models` top-level element](/reference/compose-file/models.md) in your Compose file, you can:
26+
27+
- Declare which AI models your application needs
28+
- Specify model configurations and requirements
29+
- Make your application portable across different platforms
30+
- Let the platform handle model provisioning and lifecycle management
31+
32+
## Basic model definition
33+
34+
To define models in your Compose application, use the `models` top-level element:
35+
36+
```yaml
37+
services:
38+
chat-app:
39+
image: my-chat-app
40+
models:
41+
- llm
42+
43+
models:
44+
llm:
45+
image: ai/smollm2
46+
```
47+
48+
This example defines:
49+
- A service called `chat-app` that uses a model named `llm`
50+
- A model definition for `llm` that references the `ai/smollm2` model image
51+
52+
## Model configuration options
53+
54+
Models support various configuration options:
55+
56+
```yaml
57+
models:
58+
llm:
59+
image: ai/smollm2
60+
context_size: 1024
61+
runtime_flags:
62+
- "--a-flag"
63+
- "--another-flag=42"
64+
```
65+
66+
Common configuration options include:
67+
- `model` (required): The OCI artifact identifier for the model. This is what Compose pulls and runs via the model runner.
68+
- `context_size`: Defines the maximum token context size for the model.
69+
- `runtime_flags`: A list of raw command-line flags passed to the inference engine when the model is started.
70+
- Platform-specific options may also be available via extensions attributes `x-*`
71+
72+
## Service model binding
73+
74+
Services can reference models in two ways: short syntax and long syntax.
75+
76+
### Short syntax
77+
78+
The short syntax is the simplest way to bind a model to a service:
79+
80+
```yaml
81+
services:
82+
app:
83+
image: my-app
84+
models:
85+
- llm
86+
- embedding-model
87+
88+
models:
89+
llm:
90+
image: ai/smollm2
91+
embedding-model:
92+
image: ai/all-minilm
93+
```
94+
95+
With short syntax, the platform automatically generates environment variables based on the model name:
96+
- `LLM_URL` - URL to access the llm model
97+
- `LLM_MODEL` - Model identifier for the llm model
98+
- `EMBEDDING_MODEL_URL` - URL to access the embedding-model
99+
- `EMBEDDING_MODEL_MODEL` - Model identifier for the embedding-model
100+
101+
### Long syntax
102+
103+
The long syntax allows you to customize environment variable names:
104+
105+
```yaml
106+
services:
107+
app:
108+
image: my-app
109+
models:
110+
llm:
111+
endpoint_var: AI_MODEL_URL
112+
model_var: AI_MODEL_NAME
113+
embedding-model:
114+
endpoint_var: EMBEDDING_URL
115+
model_var: EMBEDDING_NAME
116+
117+
models:
118+
llm:
119+
image: ai/smollm2
120+
embedding-model:
121+
image: ai/all-minilm
122+
```
123+
124+
With this configuration, your service receives:
125+
- `AI_MODEL_URL` and `AI_MODEL_NAME` for the LLM model
126+
- `EMBEDDING_URL` and `EMBEDDING_NAME` for the embedding model
127+
128+
## Platform portability
129+
130+
One of the key benefits of using Compose models is portability across different platforms that support the Compose specification.
131+
132+
### Docker Model Runner
133+
134+
When Docker Model Runner is enabled:
135+
136+
```yaml
137+
services:
138+
chat-app:
139+
image: my-chat-app
140+
models:
141+
- llm
142+
143+
models:
144+
llm:
145+
image: ai/smollm2
146+
```
147+
148+
Docker Model Runner will:
149+
- Pull and run the specified model locally
150+
- Provide endpoint URLs for accessing the model
151+
- Inject environment variables into the service
152+
153+
### Cloud providers
154+
155+
The same Compose file can run on cloud providers that support Compose models:
156+
157+
```yaml
158+
services:
159+
chat-app:
160+
image: my-chat-app
161+
models:
162+
- llm
163+
164+
models:
165+
llm:
166+
image: ai/smollm2
167+
# Cloud-specific configurations
168+
labels:
169+
- "cloud.instance-type=gpu-small"
170+
- "cloud.region=us-west-2"
171+
```
172+
173+
Cloud providers might:
174+
- Use managed AI services instead of running models locally
175+
- Apply cloud-specific optimizations and scaling
176+
- Provide additional monitoring and logging capabilities
177+
- Handle model versioning and updates automatically
178+
179+
## Reference
180+
181+
- [`models` top-level element](/reference/compose-file/models.md)
182+
- [`models` attribute](/reference/compose-file/services.md#models)
183+
- [Docker Model Runner documentation](/manuals/ai/model-runner.md)
184+
- [Compose Model Runner documentation](/manuals/compose/how-tos/model-runner.md)]

content/manuals/compose/_index.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ title: Docker Compose
33
weight: 30
44
description: Learn how to use Docker Compose to define and run multi-container applications
55
with this detailed introduction to the tool.
6-
keywords: docker compose, docker-compose, docker compose command, docker compose files,
7-
docker compose documentation, using docker compose, compose container, docker compose
8-
service
6+
keywords: docker compose, docker-compose, compose.yaml, docker compose command, multi-container applications, container orchestration, docker cli
97
params:
108
sidebar:
119
group: Open source
@@ -36,6 +34,10 @@ grid:
3634
Docker application.
3735
icon: polyline
3836
link: /reference/compose-file
37+
- title: Use Compose Bridge
38+
description: Transform your Compose configuration file into configuration files for different platforms, such as Kubernetes.
39+
icon: move_down
40+
link: /compose/bridge
3941
- title: Browse common FAQs
4042
description: Explore general FAQs and find out how to give feedback.
4143
icon: help
@@ -58,12 +60,12 @@ It is the key to unlocking a streamlined and efficient development and deploymen
5860
Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single YAML configuration file. Then, with a single command, you create and start all the services
5961
from your configuration file.
6062

61-
Compose works in all environments; production, staging, development, testing, as
63+
Compose works in all environments - production, staging, development, testing, as
6264
well as CI workflows. It also has commands for managing the whole lifecycle of your application:
6365

64-
* Start, stop, and rebuild services
65-
* View the status of running services
66-
* Stream the log output of running services
67-
* Run a one-off command on a service
66+
- Start, stop, and rebuild services
67+
- View the status of running services
68+
- Stream the log output of running services
69+
- Run a one-off command on a service
6870

6971
{{< grid >}}

content/manuals/compose/bridge/_index.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ Compose Bridge provides its own transformation for Kubernetes using Go templates
2424

2525
For more detailed information on how these transformations work and how you can customize them for your projects, see [Customize](customize.md).
2626

27-
## Setup
28-
29-
To get started with Compose Bridge, you need to:
30-
31-
1. Download and install Docker Desktop version 4.33 and later.
32-
2. Sign in to your Docker account.
33-
3. Navigate to the **Beta features** tab in **Settings**.
34-
4. Select **Enable Compose Bridge**.
35-
5. Select **Apply & restart**.
36-
37-
## Feedback
38-
39-
To give feedback, report bugs, or receive support, email `[email protected]`. There is also a dedicated Slack channel. To join, simply send an email to the provided address.
40-
4127
## What's next?
4228

4329
- [Use Compose Bridge](usage.md)

content/manuals/compose/gettingstarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Check out this tutorial on how to use Docker Compose from defining application
2+
description: Follow this hands-on tutorial to learn how to use Docker Compose from defining application
33
dependencies to experimenting with commands.
44
keywords: docker compose example, docker compose tutorial, how to use docker compose,
55
running docker compose, how to run docker compose, docker compose build image, docker

content/manuals/compose/install/_index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
description: Learn how to install Docker Compose. Compose is available natively on
33
Docker Desktop, as a Docker Engine plugin, and as a standalone tool.
4-
keywords: install docker compose, docker compose install, install docker compose ubuntu,
5-
installing docker compose, docker compose download, docker compose not found, docker
6-
compose windows, how to install docker compose
4+
keywords: install docker compose, docker compose plugin, install compose linux, install docker desktop, docker compose windows, standalone docker compose, docker compose not found
75
title: Overview of installing Docker Compose
86
linkTitle: Install
97
weight: 20
@@ -18,7 +16,7 @@ This page summarizes the different ways you can install Docker Compose, dependin
1816

1917
## Installation scenarios
2018

21-
### Scenario one: Install Docker Desktop (Recommended)
19+
### Docker Desktop (Recommended)
2220

2321
The easiest and recommended way to get Docker Compose is to install Docker Desktop.
2422

@@ -33,7 +31,7 @@ Docker Desktop is available for:
3331
>
3432
> If you have already installed Docker Desktop, you can check which version of Compose you have by selecting **About Docker Desktop** from the Docker menu {{< inline-image src="../../desktop/images/whale-x.svg" alt="whale menu" >}}.
3533
36-
### Scenario two: Install the Docker Compose plugin (Linux only)
34+
### Plugin (Linux only)
3735

3836
> [!IMPORTANT]
3937
>
@@ -43,7 +41,7 @@ If you already have Docker Engine and Docker CLI installed, you can install the
4341
- [Using Docker's repository](linux.md#install-using-the-repository)
4442
- [Downloading and installing manually](linux.md#install-the-plugin-manually)
4543

46-
### Scenario three: Install the Docker Compose standalone (Legacy)
44+
### Standalone (Legacy)
4745

4846
> [!WARNING]
4947
>

content/manuals/compose/install/linux.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
2-
description: Download and install Docker Compose on Linux with this step-by-step handbook.
3-
This plugin can be installed manually or by using a repository.
4-
keywords: install docker compose linux, docker compose linux, docker compose plugin,
5-
docker-compose-plugin, linux install docker compose, install docker-compose linux,
6-
linux install docker-compose, linux docker compose, docker compose v2 linux, install
7-
docker compose on linux
2+
description: Step-by-step instructions for installing the Docker Compose plugin on Linux using a package repository or manual method.
3+
keywords: install docker compose linux, docker compose plugin, docker-compose-plugin linux, docker compose v2, docker compose manual install, linux docker compose
84
toc_max: 3
95
title: Install the Docker Compose plugin
106
linkTitle: Plugin
@@ -77,9 +73,9 @@ To update the Docker Compose plugin, run the following commands:
7773

7874
## Install the plugin manually
7975

80-
> [!IMPORTANT]
76+
> [!WARNING]
8177
>
82-
> This option requires you to manage upgrades manually. It is recommended that you set up Docker's repository for easier maintenance.
78+
> Manual installations don’t auto-update. For ease of maintenance, use the Docker repository method.
8379

8480
1. To download and install the Docker Compose CLI plugin, run:
8581

@@ -113,4 +109,8 @@ To update the Docker Compose plugin, run the following commands:
113109
```console
114110
$ docker compose version
115111
```
116-
112+
113+
## What's next?
114+
115+
- [Understand how Compose works](/manuals/compose/intro/compose-application-model.md)
116+
- [Try the Quickstart guide](/manuals/compose/gettingstarted.md)

content/manuals/compose/install/standalone.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: Install the Docker Compose standalone
33
linkTitle: Standalone
4-
description: How to install Docker Compose - Other Scenarios
5-
keywords: compose, orchestration, install, installation, docker, documentation
4+
description: Instructions for installing the legacy Docker Compose standalone tool on Linux and Windows Server
5+
keywords: install docker-compose, standalone docker compose, docker-compose windows server, install docker compose linux, legacy compose install
66
toc_max: 3
77
weight: 20
88
---
@@ -12,7 +12,8 @@ This page contains instructions on how to install Docker Compose standalone on L
1212
> [!WARNING]
1313
>
1414
> The Docker Compose standalone uses the `-compose` syntax instead of the current standard syntax `compose`.
15-
> For example, you must type `docker-compose up` when using Docker Compose standalone, instead of `docker compose up`.
15+
> For example, you must type `docker-compose up` when using Docker Compose standalone, instead of `docker compose up`.
16+
> Use it only for backward compatibility.
1617
1718
## On Linux
1819

@@ -74,3 +75,8 @@ on Microsoft Windows Server](/manuals/engine/install/binaries.md#install-server-
7475
$ docker-compose.exe version
7576
Docker Compose version {{% param "compose_version" %}}
7677
```
78+
79+
## What's next?
80+
81+
- [Understand how Compose works](/manuals/compose/intro/compose-application-model.md)
82+
- [Try the Quickstart guide](/manuals/compose/gettingstarted.md)

0 commit comments

Comments
 (0)