diff --git a/assets/css/global.css b/assets/css/global.css index 90887417a2ab..82f0fc386479 100644 --- a/assets/css/global.css +++ b/assets/css/global.css @@ -95,3 +95,9 @@ input[type="search"]::-ms-clear { .navbar-group:first-of-type { margin-top: 0.2rem !important; } + +#search-page-results { + mark:where(.dark, .dark *) { + color: var(--color-blue-400); + } +} diff --git a/assets/css/utilities.css b/assets/css/utilities.css index d3cbc10a734f..ee01aaadc7ff 100644 --- a/assets/css/utilities.css +++ b/assets/css/utilities.css @@ -253,3 +253,7 @@ @utility chip { @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; } + +@utility pagination-link { + @apply flex items-center justify-center rounded-sm p-2; +} diff --git a/content/manuals/ai/compose/_index.md b/content/manuals/ai/compose/_index.md new file mode 100644 index 000000000000..a861d426a60e --- /dev/null +++ b/content/manuals/ai/compose/_index.md @@ -0,0 +1,9 @@ +--- +build: + render: never +title: AI and Docker Compose +weight: 40 +params: + sidebar: + group: AI +--- \ No newline at end of file diff --git a/content/manuals/ai/compose/models-and-compose.md b/content/manuals/ai/compose/models-and-compose.md new file mode 100644 index 000000000000..bdfb0de5eb65 --- /dev/null +++ b/content/manuals/ai/compose/models-and-compose.md @@ -0,0 +1,184 @@ +--- +title: Define AI Models in Docker Compose applications +linkTitle: Use AI models in Compose +description: Learn how to define and use AI models in Docker Compose applications using the models top-level element +keywords: compose, docker compose, models, ai, machine learning, cloud providers, specification +weight: 10 +params: + sidebar: + badge: + color: green + text: New +--- + +{{< summary-bar feature_name="Compose models" >}} + +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. + +## Prerequisites + +- Docker Compose v2.38 or later +- A platform that supports Compose models such as Docker Model Runner or compatible cloud providers + +## What are Compose models? + +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: + +- Declare which AI models your application needs +- Specify model configurations and requirements +- Make your application portable across different platforms +- Let the platform handle model provisioning and lifecycle management + +## Basic model definition + +To define models in your Compose application, use the `models` top-level element: + +```yaml +services: + chat-app: + image: my-chat-app + models: + - llm + +models: + llm: + image: ai/smollm2 +``` + +This example defines: +- A service called `chat-app` that uses a model named `llm` +- A model definition for `llm` that references the `ai/smollm2` model image + +## Model configuration options + +Models support various configuration options: + +```yaml +models: + llm: + image: ai/smollm2 + context_size: 1024 + runtime_flags: + - "--a-flag" + - "--another-flag=42" +``` + +Common configuration options include: +- `model` (required): The OCI artifact identifier for the model. This is what Compose pulls and runs via the model runner. +- `context_size`: Defines the maximum token context size for the model. +- `runtime_flags`: A list of raw command-line flags passed to the inference engine when the model is started. +- Platform-specific options may also be available via extensions attributes `x-*` + +## Service model binding + +Services can reference models in two ways: short syntax and long syntax. + +### Short syntax + +The short syntax is the simplest way to bind a model to a service: + +```yaml +services: + app: + image: my-app + models: + - llm + - embedding-model + +models: + llm: + image: ai/smollm2 + embedding-model: + image: ai/all-minilm +``` + +With short syntax, the platform automatically generates environment variables based on the model name: +- `LLM_URL` - URL to access the llm model +- `LLM_MODEL` - Model identifier for the llm model +- `EMBEDDING_MODEL_URL` - URL to access the embedding-model +- `EMBEDDING_MODEL_MODEL` - Model identifier for the embedding-model + +### Long syntax + +The long syntax allows you to customize environment variable names: + +```yaml +services: + app: + image: my-app + models: + llm: + endpoint_var: AI_MODEL_URL + model_var: AI_MODEL_NAME + embedding-model: + endpoint_var: EMBEDDING_URL + model_var: EMBEDDING_NAME + +models: + llm: + image: ai/smollm2 + embedding-model: + image: ai/all-minilm +``` + +With this configuration, your service receives: +- `AI_MODEL_URL` and `AI_MODEL_NAME` for the LLM model +- `EMBEDDING_URL` and `EMBEDDING_NAME` for the embedding model + +## Platform portability + +One of the key benefits of using Compose models is portability across different platforms that support the Compose specification. + +### Docker Model Runner + +When Docker Model Runner is enabled: + +```yaml +services: + chat-app: + image: my-chat-app + models: + - llm + +models: + llm: + image: ai/smollm2 +``` + +Docker Model Runner will: +- Pull and run the specified model locally +- Provide endpoint URLs for accessing the model +- Inject environment variables into the service + +### Cloud providers + +The same Compose file can run on cloud providers that support Compose models: + +```yaml +services: + chat-app: + image: my-chat-app + models: + - llm + +models: + llm: + image: ai/smollm2 + # Cloud-specific configurations + labels: + - "cloud.instance-type=gpu-small" + - "cloud.region=us-west-2" +``` + +Cloud providers might: +- Use managed AI services instead of running models locally +- Apply cloud-specific optimizations and scaling +- Provide additional monitoring and logging capabilities +- Handle model versioning and updates automatically + +## Reference + +- [`models` top-level element](/reference/compose-file/models.md) +- [`models` attribute](/reference/compose-file/services.md#models) +- [Docker Model Runner documentation](/manuals/ai/model-runner.md) +- [Compose Model Runner documentation](/manuals/compose/how-tos/model-runner.md)] \ No newline at end of file diff --git a/content/manuals/compose/_index.md b/content/manuals/compose/_index.md index 8f16cd62fedd..79d08ec6bff3 100644 --- a/content/manuals/compose/_index.md +++ b/content/manuals/compose/_index.md @@ -3,9 +3,7 @@ title: Docker Compose weight: 30 description: Learn how to use Docker Compose to define and run multi-container applications with this detailed introduction to the tool. -keywords: docker compose, docker-compose, docker compose command, docker compose files, - docker compose documentation, using docker compose, compose container, docker compose - service +keywords: docker compose, docker-compose, compose.yaml, docker compose command, multi-container applications, container orchestration, docker cli params: sidebar: group: Open source @@ -36,6 +34,10 @@ grid: Docker application. icon: polyline link: /reference/compose-file +- title: Use Compose Bridge + description: Transform your Compose configuration file into configuration files for different platforms, such as Kubernetes. + icon: move_down + link: /compose/bridge - title: Browse common FAQs description: Explore general FAQs and find out how to give feedback. icon: help @@ -58,12 +60,12 @@ It is the key to unlocking a streamlined and efficient development and deploymen 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 from your configuration file. -Compose works in all environments; production, staging, development, testing, as +Compose works in all environments - production, staging, development, testing, as well as CI workflows. It also has commands for managing the whole lifecycle of your application: - * Start, stop, and rebuild services - * View the status of running services - * Stream the log output of running services - * Run a one-off command on a service + - Start, stop, and rebuild services + - View the status of running services + - Stream the log output of running services + - Run a one-off command on a service {{< grid >}} diff --git a/content/manuals/compose/bridge/_index.md b/content/manuals/compose/bridge/_index.md index 37bf983320a0..5a4265875b8c 100644 --- a/content/manuals/compose/bridge/_index.md +++ b/content/manuals/compose/bridge/_index.md @@ -24,20 +24,6 @@ Compose Bridge provides its own transformation for Kubernetes using Go templates For more detailed information on how these transformations work and how you can customize them for your projects, see [Customize](customize.md). -## Setup - -To get started with Compose Bridge, you need to: - -1. Download and install Docker Desktop version 4.33 and later. -2. Sign in to your Docker account. -3. Navigate to the **Beta features** tab in **Settings**. -4. Select **Enable Compose Bridge**. -5. Select **Apply & restart**. - -## Feedback - -To give feedback, report bugs, or receive support, email `desktop-preview@docker.com`. There is also a dedicated Slack channel. To join, simply send an email to the provided address. - ## What's next? - [Use Compose Bridge](usage.md) diff --git a/content/manuals/compose/gettingstarted.md b/content/manuals/compose/gettingstarted.md index 70edc888e4ac..dcbfd3fd5c1b 100644 --- a/content/manuals/compose/gettingstarted.md +++ b/content/manuals/compose/gettingstarted.md @@ -1,5 +1,5 @@ --- -description: Check out this tutorial on how to use Docker Compose from defining application +description: Follow this hands-on tutorial to learn how to use Docker Compose from defining application dependencies to experimenting with commands. keywords: docker compose example, docker compose tutorial, how to use docker compose, running docker compose, how to run docker compose, docker compose build image, docker diff --git a/content/manuals/compose/install/_index.md b/content/manuals/compose/install/_index.md index 750c05b10d18..510942e8f981 100644 --- a/content/manuals/compose/install/_index.md +++ b/content/manuals/compose/install/_index.md @@ -1,9 +1,7 @@ --- description: Learn how to install Docker Compose. Compose is available natively on Docker Desktop, as a Docker Engine plugin, and as a standalone tool. -keywords: install docker compose, docker compose install, install docker compose ubuntu, - installing docker compose, docker compose download, docker compose not found, docker - compose windows, how to install docker compose +keywords: install docker compose, docker compose plugin, install compose linux, install docker desktop, docker compose windows, standalone docker compose, docker compose not found title: Overview of installing Docker Compose linkTitle: Install weight: 20 @@ -18,7 +16,7 @@ This page summarizes the different ways you can install Docker Compose, dependin ## Installation scenarios -### Scenario one: Install Docker Desktop (Recommended) +### Docker Desktop (Recommended) The easiest and recommended way to get Docker Compose is to install Docker Desktop. @@ -33,7 +31,7 @@ Docker Desktop is available for: > > 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" >}}. -### Scenario two: Install the Docker Compose plugin (Linux only) +### Plugin (Linux only) > [!IMPORTANT] > @@ -43,7 +41,7 @@ If you already have Docker Engine and Docker CLI installed, you can install the - [Using Docker's repository](linux.md#install-using-the-repository) - [Downloading and installing manually](linux.md#install-the-plugin-manually) -### Scenario three: Install the Docker Compose standalone (Legacy) +### Standalone (Legacy) > [!WARNING] > diff --git a/content/manuals/compose/install/linux.md b/content/manuals/compose/install/linux.md index d1b47fc2d139..6862b51faea6 100644 --- a/content/manuals/compose/install/linux.md +++ b/content/manuals/compose/install/linux.md @@ -1,10 +1,6 @@ --- -description: Download and install Docker Compose on Linux with this step-by-step handbook. - This plugin can be installed manually or by using a repository. -keywords: install docker compose linux, docker compose linux, docker compose plugin, - docker-compose-plugin, linux install docker compose, install docker-compose linux, - linux install docker-compose, linux docker compose, docker compose v2 linux, install - docker compose on linux +description: Step-by-step instructions for installing the Docker Compose plugin on Linux using a package repository or manual method. +keywords: install docker compose linux, docker compose plugin, docker-compose-plugin linux, docker compose v2, docker compose manual install, linux docker compose toc_max: 3 title: Install the Docker Compose plugin linkTitle: Plugin @@ -77,9 +73,9 @@ To update the Docker Compose plugin, run the following commands: ## Install the plugin manually -> [!IMPORTANT] +> [!WARNING] > -> This option requires you to manage upgrades manually. It is recommended that you set up Docker's repository for easier maintenance. +> Manual installations don’t auto-update. For ease of maintenance, use the Docker repository method. 1. To download and install the Docker Compose CLI plugin, run: @@ -113,4 +109,8 @@ To update the Docker Compose plugin, run the following commands: ```console $ docker compose version ``` - \ No newline at end of file + +## What's next? + +- [Understand how Compose works](/manuals/compose/intro/compose-application-model.md) +- [Try the Quickstart guide](/manuals/compose/gettingstarted.md) diff --git a/content/manuals/compose/install/standalone.md b/content/manuals/compose/install/standalone.md index d878c2daf745..a6cc7106acf6 100644 --- a/content/manuals/compose/install/standalone.md +++ b/content/manuals/compose/install/standalone.md @@ -1,8 +1,8 @@ --- title: Install the Docker Compose standalone linkTitle: Standalone -description: How to install Docker Compose - Other Scenarios -keywords: compose, orchestration, install, installation, docker, documentation +description: Instructions for installing the legacy Docker Compose standalone tool on Linux and Windows Server +keywords: install docker-compose, standalone docker compose, docker-compose windows server, install docker compose linux, legacy compose install toc_max: 3 weight: 20 --- @@ -12,7 +12,8 @@ This page contains instructions on how to install Docker Compose standalone on L > [!WARNING] > > The Docker Compose standalone uses the `-compose` syntax instead of the current standard syntax `compose`. -> For example, you must type `docker-compose up` when using Docker Compose standalone, instead of `docker compose up`. +> For example, you must type `docker-compose up` when using Docker Compose standalone, instead of `docker compose up`. +> Use it only for backward compatibility. ## On Linux @@ -74,3 +75,8 @@ on Microsoft Windows Server](/manuals/engine/install/binaries.md#install-server- $ docker-compose.exe version Docker Compose version {{% param "compose_version" %}} ``` + +## What's next? + +- [Understand how Compose works](/manuals/compose/intro/compose-application-model.md) +- [Try the Quickstart guide](/manuals/compose/gettingstarted.md) diff --git a/content/manuals/compose/install/uninstall.md b/content/manuals/compose/install/uninstall.md index 16585ab8b225..714389deda04 100644 --- a/content/manuals/compose/install/uninstall.md +++ b/content/manuals/compose/install/uninstall.md @@ -2,6 +2,7 @@ description: How to uninstall Docker Compose keywords: compose, orchestration, uninstall, uninstallation, docker, documentation title: Uninstall Docker Compose +linkTitle: Uninstall --- How you uninstall Docker Compose depends on how it was installed. This guide covers uninstallation instructions for: @@ -13,7 +14,7 @@ How you uninstall Docker Compose depends on how it was installed. This guide cov If you want to uninstall Docker Compose and you have installed Docker Desktop, see [Uninstall Docker Desktop](/manuals/desktop/uninstall.md). -> [!NOTE] +> [!WARNING] > > Unless you have other Docker instances installed on that specific environment, uninstalling Docker Desktop removes all Docker components, including Docker Engine, Docker CLI, and Docker Compose. diff --git a/content/manuals/compose/intro/compose-application-model.md b/content/manuals/compose/intro/compose-application-model.md index 127e99501a9d..9e20edf3f9a6 100644 --- a/content/manuals/compose/intro/compose-application-model.md +++ b/content/manuals/compose/intro/compose-application-model.md @@ -1,8 +1,8 @@ --- title: How Compose works weight: 10 -description: Understand how Compose works and the Compose application model with an illustrative example -keywords: compose, docker compose, compose specification, compose model +description: Learn how Docker Compose works, from the application model to Compose files and CLI, whilst following a detailed example. +keywords: docker compose, compose.yaml, docker compose model, compose cli, multi-container application, compose example aliases: - /compose/compose-file/02-model/ - /compose/compose-yaml-file/ @@ -21,7 +21,7 @@ Services communicate with each other through [networks](/reference/compose-file/ Services store and share persistent data into [volumes](/reference/compose-file/volumes.md). The Specification describes such a persistent data as a high-level filesystem mount with global options. -Some services require configuration data that is dependent on the runtime or platform. For this, the Specification defines a dedicated [configs](/reference/compose-file/configs.md) concept. From a service container point of view, configs are comparable to volumes, in that they are files mounted into the container. But the actual definition involves distinct platform resources and services, which are abstracted by this type. +Some services require configuration data that is dependent on the runtime or platform. For this, the Specification defines a dedicated [configs](/reference/compose-file/configs.md) concept. From inside the container, configs behave like volumes—they’re mounted as files. However, configs are defined differently at the platform level. A [secret](/reference/compose-file/secrets.md) is a specific flavor of configuration data for sensitive data that should not be exposed without security considerations. Secrets are made available to services as files mounted into their containers, but the platform-specific resources to provide sensitive data are specific enough to deserve a distinct concept and definition within the Compose Specification. @@ -55,7 +55,9 @@ If you want to reuse other Compose files, or factor out parts of your applicatio ## CLI -The Docker CLI lets you interact with your Docker Compose applications through the `docker compose` command, and its subcommands. Using the CLI, you can manage the lifecycle of your multi-container applications defined in the `compose.yaml` file. The CLI commands enable you to start, stop, and configure your applications effortlessly. +The Docker CLI lets you interact with your Docker Compose applications through the `docker compose` command and its subcommands. If you're using Docker Desktop, the Docker Compose CLI is included by default. + +Using the CLI, you can manage the lifecycle of your multi-container applications defined in the `compose.yaml` file. The CLI commands enable you to start, stop, and configure your applications effortlessly. ### Key commands @@ -101,11 +103,11 @@ Both services communicate with each other on an isolated back-tier network, whil The example application is composed of the following parts: -- 2 services, backed by Docker images: `webapp` and `database` -- 1 secret (HTTPS certificate), injected into the frontend -- 1 configuration (HTTP), injected into the frontend -- 1 persistent volume, attached to the backend -- 2 networks +- Two services, backed by Docker images: `webapp` and `database` +- One secret (HTTPS certificate), injected into the frontend +- One configuration (HTTP), injected into the frontend +- One persistent volume, attached to the backend +- Two networks ```yml services: @@ -162,6 +164,6 @@ example-backend-1 example/database "docker-entrypoint.s…" backend ## What's next -- [Quickstart](/manuals/compose/gettingstarted.md) +- [Try the Quickstart guide](/manuals/compose/gettingstarted.md) - [Explore some sample applications](/manuals/compose/support-and-feedback/samples-for-compose.md) - [Familiarize yourself with the Compose Specification](/reference/compose-file/_index.md) diff --git a/content/manuals/compose/intro/features-uses.md b/content/manuals/compose/intro/features-uses.md index 1545bd81407b..707b1539d199 100644 --- a/content/manuals/compose/intro/features-uses.md +++ b/content/manuals/compose/intro/features-uses.md @@ -1,6 +1,6 @@ --- -description: Key benefits and use cases of Docker Compose -keywords: documentation, docs, docker, compose, orchestration, containers, uses, benefits +description: Discover the benefits and typical use cases of Docker Compose for containerized application development and deployment +keywords: docker compose, compose use cases, compose benefits, container orchestration, development environments, testing containers, yaml file title: Why use Compose? weight: 20 aliases: @@ -11,16 +11,14 @@ aliases: Using Docker Compose offers several benefits that streamline the development, deployment, and management of containerized applications: -- Simplified control: Docker Compose allows you to define and manage multi-container applications in a single YAML file. This simplifies the complex task of orchestrating and coordinating various services, making it easier to manage and replicate your application environment. +- Simplified control: Define and manage multi-container apps in one YAML file, streamlining orchestration and replication. -- Efficient collaboration: Docker Compose configuration files are easy to share, facilitating collaboration among developers, operations teams, and other stakeholders. This collaborative approach leads to smoother workflows, faster issue resolution, and increased overall efficiency. +- Efficient collaboration: Shareable YAML files support smooth collaboration between developers and operations, improving workflows and issue resolution, leading to increased overall efficiency. - Rapid application development: Compose caches the configuration used to create a container. When you restart a service that has not changed, Compose re-uses the existing containers. Re-using containers means that you can make changes to your environment very quickly. - Portability across environments: Compose supports variables in the Compose file. You can use these variables to customize your composition for different environments, or different users. -- Extensive community and support: Docker Compose benefits from a vibrant and active community, which means abundant resources, tutorials, and support. This community-driven ecosystem contributes to the continuous improvement of Docker Compose and helps users troubleshoot issues effectively. - ## Common use cases of Docker Compose Compose can be used in many different ways. Some common use cases are outlined @@ -67,4 +65,4 @@ For details on using production-oriented features, see - [Learn about the history of Compose](history.md) - [Understand how Compose works](compose-application-model.md) -- [Quickstart](../gettingstarted.md) +- [Try the Quickstart guide](../gettingstarted.md) diff --git a/content/manuals/compose/intro/history.md b/content/manuals/compose/intro/history.md index 862cb9eb12b3..a46cc78297ce 100644 --- a/content/manuals/compose/intro/history.md +++ b/content/manuals/compose/intro/history.md @@ -1,7 +1,7 @@ --- title: History and development of Docker Compose linkTitle: History and development -description: History of Compose v1 and Compose YAML schema versioning +description: Explore the evolution of Docker Compose from v1 to v2, including CLI changes, YAML versioning, and the Compose Specification. keywords: compose, compose yaml, swarm, migration, compatibility, docker compose vs docker-compose weight: 30 aliases: @@ -11,7 +11,7 @@ aliases: This page provides: - A brief history of the development of the Docker Compose CLI - A clear explanation of the major versions and file formats that make up Compose v1 and Compose v2 - - The main differences between Compose V1 and Compose v2 + - The main differences between Compose v1 and Compose v2 ## Introduction @@ -24,7 +24,7 @@ It also provides a quick snapshot of the differences in file formats, command-li ### Docker Compose CLI versioning Version one of the Docker Compose command-line binary was first released in 2014. It was written in Python, and is invoked with `docker-compose`. -Typically, Compose V1 projects include a top-level `version` element in the `compose.yaml` file, with values ranging from `2.0` to `3.8`, which refer to the specific [file formats](#compose-file-format-versioning). +Typically, Compose v1 projects include a top-level `version` element in the `compose.yaml` file, with values ranging from `2.0` to `3.8`, which refer to the specific [file formats](#compose-file-format-versioning). Version two of the Docker Compose command-line binary was announced in 2020, is written in Go, and is invoked with `docker compose`. Compose v2 ignores the `version` top-level element in the `compose.yaml` file. @@ -33,7 +33,7 @@ Compose v2 ignores the `version` top-level element in the `compose.yaml` file. The Docker Compose CLIs are defined by specific file formats. -Three major versions of the Compose file format for Compose V1 were released: +Three major versions of the Compose file format for Compose v1 were released: - Compose file format 1 with Compose 1.0.0 in 2014 - Compose file format 2.x with Compose 1.6.0 in 2016 - Compose file format 3.x with Compose 1.10.0 in 2017 @@ -48,3 +48,9 @@ To address confusion around Compose CLI versioning, Compose file format versioni Compose v2 uses the Compose Specification for project definition. Unlike the prior file formats, the Compose Specification is rolling and makes the `version` top-level element optional. Compose v2 also makes use of optional specifications - [Deploy](/reference/compose-file/deploy.md), [Develop](/reference/compose-file/develop.md), and [Build](/reference/compose-file/build.md). To make [migration](/manuals/compose/releases/migrate.md) easier, Compose v2 has backwards compatibility for certain elements that have been deprecated or changed between Compose file format 2.x/3.x and the Compose Specification. + +## What's next? + +- [How Compose works](compose-application-model.md) +- [Compose Specification reference](/reference/compose-file/_index.md) +- [Migrate from Compose v1 to v2](/manuals/compose/releases/migrate.md) diff --git a/data/summary.yaml b/data/summary.yaml index a3d47b5a67fe..a75b022507ef 100644 --- a/data/summary.yaml +++ b/data/summary.yaml @@ -70,7 +70,7 @@ Compliance reporting: Compose attach: requires: Docker Compose [2.20.0](/manuals/compose/releases/release-notes.md#2200) and later Compose bridge: - availability: Beta + requires: Docker Desktop 4.43.0 and later Config profiles: requires: Docker Desktop 4.36 and later Compose dependent images: diff --git a/layouts/_default/search.html b/layouts/_default/search.html index f83708f9c24b..841cd4276baa 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -133,14 +133,14 @@