Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENGDOCS-2228 #20940

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ You can use Docker (surprise) to build and serve the files locally.

> [!IMPORTANT]
> This requires Docker Desktop version **4.24** or later, or Docker Engine with Docker
> Compose version [**2.22**](https://docs.docker.com/compose/file-watch/) or later.
> Compose version [**2.22**](https://docs.docker.com/compose/how-tos/file-watch/) or later.

1. [Fork the docker/docs repository.](https://github.com/docker/docs/fork)

Expand Down
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ grid:
- text: "Try Docker Compose"
url: "/compose/gettingstarted/"
- text: "Release notes"
url: "/compose/release-notes/"
url: "/compose/releases/release-notes/"
- title: Docker Hub
icon: device_hub
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ This command runs a Postgres container, sets an environment variable for passwor

## Additional resources

* [Ways to set environment variables with Compose](/compose/environment-variables/set-environment-variables/)
* [Ways to set environment variables with Compose](/compose/how-tos/environment-variables/set-environment-variables/)
* [What is a container](/get-started/docker-concepts/the-basics/what-is-a-container/)

## Next steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ This page was a brief introduction to Compose. In the following resources, you c

* [Overview of Docker Compose](/compose/)
* [Overview of Docker Compose CLI](/compose/reference/)
* [How Compose works](/compose/compose-application-model/)
* [How Compose works](/compose/intro/compose-application-model/)
4 changes: 2 additions & 2 deletions content/guides/language/cpp/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ git clone https://github.com/Pradumnasaraf/c-plus-plus-docker.git

Use Compose Watch to automatically update your running Compose services as you
edit and save your code. For more details about Compose Watch, see [Use Compose
Watch](/manuals/compose/file-watch.md).
Watch](/manuals/compose/how-tos/file-watch.md).

Open your `compose.yml` file in an IDE or text editor and then add the Compose Watch instructions. The following example shows how to add Compose Watch to your `compose.yml` file.

Expand Down Expand Up @@ -67,7 +67,7 @@ In this section, you also learned how to use Compose Watch to automatically rebu

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Multi-stage builds](/manuals/build/building/multi-stage.md)

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/dotnet/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Press `ctrl+c` in the terminal to stop your application.

## Automatically update services

Use Compose Watch to automatically update your running Compose services as you edit and save your code. For more details about Compose Watch, see [Use Compose Watch](/manuals/compose/file-watch.md).
Use Compose Watch to automatically update your running Compose services as you edit and save your code. For more details about Compose Watch, see [Use Compose Watch](/manuals/compose/how-tos/file-watch.md).

Open your `compose.yaml` file in an IDE or text editor and then add the Compose Watch instructions. The following is the updated `compose.yaml` file.

Expand Down Expand Up @@ -387,7 +387,7 @@ database and persist data. You also learned how to use Compose Watch to automati

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Multi-stage builds](/manuals/build/building/multi-stage.md)

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/java/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Press `ctrl+c` in the terminal to stop your application.

Use Compose Watch to automatically update your running Compose services as you
edit and save your code. For more details about Compose Watch, see
[Use Compose Watch](/manuals/compose/file-watch.md).
[Use Compose Watch](/manuals/compose/how-tos/file-watch.md).

Open your `docker-compose.yaml` file in an IDE or text editor and then add the
Compose Watch instructions. The following is the updated `docker-compose.yaml`
Expand Down Expand Up @@ -340,7 +340,7 @@ In this section, you took a look at running a database locally and persisting th
Related information:

- [Compose file reference](/reference/compose-file/)
- [Compose Watch](/manuals/compose/file-watch.md)
- [Compose Watch](/manuals/compose/how-tos/file-watch.md)
- [Dockerfile reference](/reference/dockerfile/)

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/php/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Press `ctrl+c` in the terminal to stop your application.

## Automatically update services

Use Compose Watch to automatically update your running Compose services as you edit and save your code. For more details about Compose Watch, see [Use Compose Watch](/manuals/compose/file-watch.md).
Use Compose Watch to automatically update your running Compose services as you edit and save your code. For more details about Compose Watch, see [Use Compose Watch](/manuals/compose/how-tos/file-watch.md).

Open your `compose.yaml` file in an IDE or text editor and then add the Compose Watch instructions. The following is the updated `compose.yaml` file.

Expand Down Expand Up @@ -422,7 +422,7 @@ database and persist data. You also learned how to use Compose Watch to automati

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Dockerfile reference](/reference/dockerfile.md)
- [Official Docker Image for PHP](https://hub.docker.com/_/php)

Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/python/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ Press `ctrl+c` in the terminal to stop your application.

Use Compose Watch to automatically update your running Compose services as you
edit and save your code. For more details about Compose Watch, see [Use Compose
Watch](/manuals/compose/file-watch.md).
Watch](/manuals/compose/how-tos/file-watch.md).

Open your `compose.yaml` file in an IDE or text editor and then add the Compose
Watch instructions. The following is the updated `compose.yaml` file.
Expand Down Expand Up @@ -562,7 +562,7 @@ database and persist data. You also learned how to use Compose Watch to automati

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Multi-stage builds](/manuals/build/building/multi-stage.md)

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/r/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Press `ctrl+c` in the terminal to stop your application.

Use Compose Watch to automatically update your running Compose services as you
edit and save your code. For more details about Compose Watch, see [Use Compose
Watch](/manuals/compose/file-watch.md).
Watch](/manuals/compose/how-tos/file-watch.md).

Lines 15 to 18 in the `compose.yaml` file contain properties that trigger Docker
to rebuild the image when a file in the current working directory is changed:
Expand Down Expand Up @@ -213,7 +213,7 @@ database and persist data. You also learned how to use Compose Watch to automati

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Multi-stage builds](/manuals/build/building/multi-stage.md)

## Next steps
Expand Down
4 changes: 2 additions & 2 deletions content/guides/language/ruby/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Press `ctrl+c` in the terminal to stop your application and run `docker compose

Use Compose Watch to automatically update your running Compose services as you
edit and save your code. For more details about Compose Watch, see [Use Compose
Watch](/manuals/compose/file-watch.md).
Watch](/manuals/compose/how-tos/file-watch.md).

Open your `compose.yaml` file in an IDE or text editor and then add the Compose
Watch instructions. The following is the updated `compose.yaml` file.
Expand Down Expand Up @@ -193,7 +193,7 @@ database and persist data. You also learned how to use Compose Watch to automati

Related information:
- [Compose file reference](/reference/compose-file/)
- [Compose file watch](/manuals/compose/file-watch.md)
- [Compose file watch](/manuals/compose/how-tos/file-watch.md)
- [Multi-stage builds](/manuals/build/building/multi-stage.md)

## Next steps
Expand Down
2 changes: 1 addition & 1 deletion content/guides/language/rust/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ secrets:
file: db/password.txt
```

Note that the file doesn't specify a network for those 2 services. When you use Compose, it automatically creates a network and connects the services to it. For more information see [Networking in Compose](/manuals/compose/networking.md).
Note that the file doesn't specify a network for those 2 services. When you use Compose, it automatically creates a network and connects the services to it. For more information see [Networking in Compose](/manuals/compose/how-tos/networking.md).

Before you run the application using Compose, notice that this Compose file specifies a `password.txt` file to hold the database's password. You must create this file as it's not included in the source repository.

Expand Down
2 changes: 1 addition & 1 deletion content/guides/use-case/genai-pdf-bot/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ To run Ollama in a container and provide GPU access:

> [!NOTE]
>
> For more details about the Compose instructions, see [Turn on GPU access with Docker Compose](/manuals/compose/gpu-support.md).
> For more details about the Compose instructions, see [Turn on GPU access with Docker Compose](/manuals/compose/how-tos/gpu-support.md).

3. Add the ollama-pull service to your `compose.yaml` file. This service uses
the `docker/genai:ollama-pull` image, based on the GenAI Stack's
Expand Down
2 changes: 1 addition & 1 deletion content/guides/use-case/rag-ollama/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ To run Ollama in a container and provide GPU access:
```

> [!NOTE]
> For more details about the Compose instructions, see [Turn on GPU access with Docker Compose](/manuals/compose/gpu-support.md).
> For more details about the Compose instructions, see [Turn on GPU access with Docker Compose](/manuals/compose/how-tos/gpu-support.md).

3. Once the Ollama container is up and running it is possible to use the `download_model.sh` inside the `tools` folder with this command:

Expand Down
2 changes: 1 addition & 1 deletion content/guides/use-case/tensorflowjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ Docker Compose is a tool for defining and running multi-container Docker
applications. With Compose, you use a YAML file to configure your application's
services, networks, and volumes. In this case, the application isn't a
multi-container application, but Docker Compose has other useful features for
development, like [Compose Watch](/manuals/compose/file-watch.md).
development, like [Compose Watch](/manuals/compose/how-tos/file-watch.md).

The sample application doesn't have a Compose file yet. To create a Compose
file, in the `TensorJS-Face-Detection` directory, create a text file named
Expand Down
10 changes: 5 additions & 5 deletions content/learning-paths/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ This command starts only the services associated with the `dev` profile,
leaving the rest inactive.

For more information on using profiles, see [Using profiles with
Compose](/compose/profiles/).
Compose](/compose/how-tos/profiles/).

### How can I enforce the database service to start up before the frontend service?

Expand All @@ -127,7 +127,7 @@ before starting. This ensures the database is not only up but also ready to
handle requests.

For more information on setting the startup order of your services, see
[Control startup and shutdown order in Compose](/compose/startup-order/).
[Control startup and shutdown order in Compose](/compose/how-tos/startup-order/).

### Can I use Compose to build a Docker image?

Expand Down Expand Up @@ -166,9 +166,9 @@ tests or perform one-off tasks within that container.

- [Overview of Docker Compose CLI](/compose/reference/)
- [Overview of Docker Compose](/compose/)
- [How Compose works](/compose/compose-application-model/)
- [Using profiles with Compose](/compose/profiles/)
- [Control startup and shutdown order with Compose](/compose/startup-order/)
- [How Compose works](/compose/intro/compose-application-model/)
- [Using profiles with Compose](/compose/how-tos/profiles/)
- [Control startup and shutdown order with Compose](/compose/how-tos/startup-order/)
- [Compose Build Specification](/compose/compose-file/build/)

{{< /accordion >}}
Expand Down
4 changes: 2 additions & 2 deletions content/manuals/compose/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ grid:
- title: How Compose works
description: Understand how Compose works
icon: category
link: /compose/compose-application-model/
link: /compose/intro/compose-application-model/
- title: Install Compose
description: Follow the instructions on how to install Docker Compose.
icon: download
Expand All @@ -41,7 +41,7 @@ grid:
- title: Migrate to Compose V2
description: Learn how to migrate from Compose V1 to V2
icon: folder_delete
link: /compose/migrate/
link: /compose/releases/migrate/
aliases:
- /compose/cli-command/
- /compose/networking/swarm/
Expand Down
2 changes: 1 addition & 1 deletion content/manuals/compose/bridge/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Understand what Compose Bridge is and how it can be useful
keywords: compose, orchestration, kubernetes, bridge
title: Overview of Compose Bridge
linkTitle: Compose Bridge
weight: 180
weight: 50
---

{{< include "compose-bridge-experimental.md" >}}
Expand Down
8 changes: 4 additions & 4 deletions content/manuals/compose/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords: docker compose example, docker compose tutorial, how to use docker com
file, run a docker compose file
title: Docker Compose Quickstart
linkTitle: Quickstart
weight: 40
weight: 30
---

This tutorial aims to introduce fundamental concepts of Docker Compose by guiding you through the development of a basic Python web application.
Expand Down Expand Up @@ -241,7 +241,7 @@ services:

Whenever a file is changed, Compose syncs the file to the corresponding location under `/code` inside the container. Once copied, the bundler updates the running application without a restart.

For more information on how Compose Watch works, see [Use Compose Watch](file-watch.md). Alternatively, see [Manage data in containers](/manuals/engine/storage/volumes.md) for other options.
For more information on how Compose Watch works, see [Use Compose Watch](/manuals/compose/how-tos/file-watch.md). Alternatively, see [Manage data in containers](/manuals/engine/storage/volumes.md) for other options.

> [!NOTE]
>
Expand Down Expand Up @@ -316,7 +316,7 @@ Using multiple Compose files lets you customize a Compose application for differ

4. Run `docker compose up` to build the app with the updated Compose files, and run it. You should see the `Hello world` message in your browser.

This is a simplified example, but it demonstrates the basic principle of `include` and how it can make it easier to modularize complex applications into sub-Compose files. For more information on `include` and working with multiple Compose files, see [Working with multiple Compose files](multiple-compose-files/_index.md).
This is a simplified example, but it demonstrates the basic principle of `include` and how it can make it easier to modularize complex applications into sub-Compose files. For more information on `include` and working with multiple Compose files, see [Working with multiple Compose files](/manuals/compose/how-tos/multiple-compose-files/_index.md).

## Step 8: Experiment with some other commands

Expand Down Expand Up @@ -349,6 +349,6 @@ This is a simplified example, but it demonstrates the basic principle of `includ
## Where to go next

- Try the [Sample apps with Compose](https://github.com/docker/awesome-compose)
- [Explore the full list of Compose commands](reference/_index.md)
- [Explore the full list of Compose commands](/reference/cli/docker/compose.md)
- [Explore the Compose file reference](/reference/compose-file/_index.md)
- [Check out the Learning Docker Compose video on LinkedIn Learning](https://www.linkedin.com/learning/learning-docker-compose/)
6 changes: 6 additions & 0 deletions content/manuals/compose/how-tos/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
build:
render: never
title: How-tos
weight: 40
---
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
title: Environment variables in Compose
linkTitle: Environment variables
weight: 60
linkTitle: Use environment variables
weight: 40
description: Explainer on the ways to set, use and manage environment variables in
Compose
keywords: compose, orchestration, environment, env file
aliases:
- /compose/environment-variables/
---

By leveraging environment variables and interpolation in Docker Compose, you can create versatile and reusable configurations, making your Dockerized applications easier to manage and deploy across different environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: Explainer on the best ways to set, use, and manage environment vari
Compose
keywords: compose, orchestration, environment, env file, environment variables
tags: [Best practices]
weight: 50
aliases:
- /compose/environment-variables/best-practices/
---

#### Handle sensitive information securely
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ linkTitle: Environment variables precedence
description: Scenario overview illustrating how environment variables are resolved
in Compose
keywords: compose, environment, env file
weight: 20
aliases:
- /compose/envvars-precedence/
- /compose/environment-variables/envvvars-precedence/
---

When the same environment variable is set in multiple sources, Docker Compose follows a precedence rule to determine the value for that variable in your container's environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ description: Compose pre-defined environment variables
keywords: fig, composition, compose, docker, orchestration, cli, reference
title: Set or change pre-defined environment variables in Docker Compose
linkTitle: Pre-defined environment variables
weight: 30
aliases:
- /compose/reference/envvars/
- /compose/environment-variables/envvars/
---

Compose already comes with pre-defined environment variables. It also inherits common Docker CLI environment variables, such as `DOCKER_HOST` and `DOCKER_CONTEXT`. See [Docker CLI environment variable reference](/reference/cli/docker/#environment-variables) for details.
Expand Down Expand Up @@ -184,7 +186,7 @@ This is an opt-out variable. When turned off it deactivates the experimental fea
## Unsupported in Compose V2

The following environment variables have no effect in Compose V2.
For more information, see [Migrate to Compose V2](../migrate.md).
For more information, see [Migrate to Compose V2](/manuals/compose/releases/migrate.md).

- `COMPOSE_API_VERSION`
By default the API version is negotiated with the server. Use `DOCKER_API_VERSION`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ keywords: compose, orchestration, environment, environment variables, container
aliases:
- /compose/env/
- /compose/link-env-deprecated/
- /compose/set-environment-variables/
---

A container's environment is not set until there's an explicit entry in the service configuration to make this happen. With Compose, there are two ways you can set environment variables in your containers with your Compose file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ title: Set, use, and manage variables in a Compose file with interpolation
linkTitle: Interpolation
description: How to set, use, and manage variables in your Compose file with interpolation
keywords: compose, orchestration, environment, variables, interpolation
weight: 40
aliases:
- /compose/env-file/
- /compose/environment-variables/env-file/
- /compose/environment-variables/variable-interpolation/
---

A Compose file can use variables to offer more flexibility. If you want to quickly switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
description: Use File watch to automatically update running services as you work
keywords: compose, file watch, experimental
title: Use Compose Watch
weight: 80
weight: 50
aliases:
- /compose/file-watch/
---

{{< introduced compose 2.22.0 "release-notes.md#2220" >}}
{{< introduced compose 2.22.0 "/manuals/compose/releases/release-notes.md#2220" >}}

{{< include "compose/watch.md" >}}

Expand Down
Loading
Loading