Skip to content

Commit f1c44df

Browse files
authored
docs triage (#25410)
<!--Delete sections as needed --> ## Description Fixes #25400 Fixes #25399 Fixes #25281 Fixes #25320 and replaces #25394 ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review --------- Signed-off-by: aevesdocker <allie.sadler@docker.com>
1 parent c73c3b5 commit f1c44df

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

content/manuals/compose/how-tos/environment-variables/envvars-precedence.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ The order of precedence (highest to lowest) is as follows:
2121
5. Set in a container image in the [ENV directive](/reference/dockerfile.md#env).
2222
Having any `ARG` or `ENV` setting in a `Dockerfile` evaluates only if there is no Docker Compose entry for `environment`, `env_file` or `run --env`.
2323

24+
> [!NOTE]
25+
>
26+
> When `--env-file` is not set, Compose may load up to two `.env` files.
27+
> It first loads one from the project directory (determined by `--project-directory`
28+
> if set, otherwise the directory of the first `-f`/`--file` Compose file, otherwise
29+
> `PWD`). If that file sets `COMPOSE_FILE` to a path in a different directory, Compose
30+
> loads a second `.env` file from that directory with lower precedence. For more
31+
> information, see [local `.env` file versus project directory `.env` file](variable-interpolation.md#local-env-file-versus-project-directory-env-file).
32+
2433
## Simple example
2534

2635
In the following example, a different value for the same environment variable in an `.env` file and with the `environment` attribute in the Compose file:

content/manuals/compose/how-tos/multiple-compose-files/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ This section contains information on the ways you can work with multiple Compose
1313

1414
Using multiple Compose files lets you customize a Compose application for different environments or workflows. This is useful for large applications that may use dozens of containers, with ownership distributed across multiple teams. For example, if your organization or team uses a monorepo, each team may have their own “local” Compose file to run a subset of the application. They then need to rely on other teams to provide a reference Compose file that defines the expected way to run their own subset. Complexity moves from the code in to the infrastructure and the configuration file.
1515

16-
The quickest way to work with multiple Compose files is to [merge](merge.md) Compose files using the `-f` flag in the command line to list out your desired Compose files. However, [merging rules](merge.md#merging-rules) means this can soon get quite complicated.
16+
The simplest way to work with multiple Compose files is to [merge](merge.md) them using
17+
the `-f` flag. This works well for straightforward overrides, but the
18+
[merging rules](merge.md#merging-rules) can make it complex to manage as your
19+
configuration grows.
1720

1821
Docker Compose provides two other options to manage this complexity when working with multiple Compose files. Depending on your project's needs, you can:
1922

content/manuals/compose/how-tos/multiple-compose-files/merge.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,22 @@ For more information, see [Using Compose in production](../production.md).
356356

357357
## Limitations
358358

359-
Docker Compose supports relative paths for the many resources to be included in the application model: build context for service images, location of file defining environment variables, path to a local directory used in a bind-mounted volume.
360-
With such a constraint, code organization in a monorepo can become hard as a natural choice would be to have dedicated folders per team or component, but then the Compose files relative paths become irrelevant.
359+
When merging Compose files, all relative paths (for build contexts, environment files,
360+
bind-mounted volumes, and other resources) are resolved relative to the base Compose file. The
361+
first file specified with `-f`, or `compose.yaml` in the current directory if `-f` is
362+
not used. Paths in override files are not resolved relative to the override file's own
363+
location.
364+
365+
This means that in a monorepo where Compose files are spread across team or component
366+
subdirectories, relative paths in those files are resolved incorrectly when used as
367+
override files.
368+
369+
> [!TIP]
370+
>
371+
> If you need each Compose file's paths to resolve relative to its own location,
372+
> use the [`include` top-level element](include.md) instead of merging with `-f`. Each
373+
> included file is loaded with its own project directory, so relative paths resolve
374+
> correctly.
361375

362376
## Reference information
363377

content/manuals/desktop/features/wsl/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ aliases:
1010
- /docker-for-windows/wsl/
1111
- /desktop/windows/wsl/
1212
- /desktop/wsl/
13+
- /docker-for-windows/wsl-tech-preview/
1314
---
1415

1516
Windows Subsystem for Linux (WSL) 2 is a full Linux kernel built by Microsoft that lets Linux distributions run without managing virtual machines. With Docker Desktop running on WSL 2, users can leverage Linux workspaces and avoid maintaining both Linux and Windows build scripts. In addition, WSL 2 provides improvements to file system sharing, faster cold-start times, and dynamic resource allocation.

0 commit comments

Comments
 (0)