Skip to content

Commit 7963973

Browse files
Update merge.md (#21340)
Stick with the preferred version of compose files according to https://docs.docker.com/compose/intro/compose-application-model/#the-compose-file <!--Delete sections as needed --> ## Description <!-- Tell us what you did and why --> ## 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
1 parent 502e61c commit 7963973

File tree

1 file changed

+14
-14
lines changed
  • content/manuals/compose/how-tos/multiple-compose-files

1 file changed

+14
-14
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ aliases:
1010

1111
Docker Compose lets you merge and override a set of Compose files together to create a composite Compose file.
1212

13-
By default, Compose reads two files, a `compose.yml` and an optional
14-
`compose.override.yml` file. By convention, the `compose.yml`
13+
By default, Compose reads two files, a `compose.yaml` and an optional
14+
`compose.override.yaml` file. By convention, the `compose.yaml`
1515
contains your base configuration. The override file can
1616
contain configuration overrides for existing services or entirely new
1717
services.
@@ -32,10 +32,10 @@ add to their predecessors.
3232
For example:
3333

3434
```console
35-
$ docker compose -f compose.yml -f compose.admin.yml run backup_db
35+
$ docker compose -f compose.yaml -f compose.admin.yaml run backup_db
3636
```
3737

38-
The `compose.yml` file might specify a `webapp` service.
38+
The `compose.yaml` file might specify a `webapp` service.
3939

4040
```yaml
4141
webapp:
@@ -46,7 +46,7 @@ webapp:
4646
- "/data"
4747
```
4848
49-
The `compose.admin.yml` may also specify this same service:
49+
The `compose.admin.yaml` may also specify this same service:
5050

5151
```yaml
5252
webapp:
@@ -226,7 +226,7 @@ For more merging rules, see [Merge and override](/reference/compose-file/merge.m
226226

227227
### Additional information
228228

229-
- Using `-f` is optional. If not provided, Compose searches the working directory and its parent directories for a `compose.yml` and a `compose.override.yml` file. You must supply at least the `compose.yml` file. If both files exist on the same directory level, Compose combines them into a single configuration.
229+
- Using `-f` is optional. If not provided, Compose searches the working directory and its parent directories for a `compose.yaml` and a `compose.override.yaml` file. You must supply at least the `compose.yaml` file. If both files exist on the same directory level, Compose combines them into a single configuration.
230230

231231
- You can use a `-f` with `-` (dash) as the filename to read the configuration from `stdin`. For example:
232232
```console
@@ -246,12 +246,12 @@ For more merging rules, see [Merge and override](/reference/compose-file/merge.m
246246

247247
- You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either from the command line or by setting up a [COMPOSE_FILE environment variable](../environment-variables/envvars.md#compose_file) in your shell or in an environment file.
248248

249-
For example, if you are running the [Compose Rails sample](https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/README.md), and have a `compose.yml` file in a directory called `sandbox/rails`. You can use a command like [docker compose pull](/reference/cli/docker/compose/pull.md) to get the postgres image for the `db` service from anywhere by using the `-f` flag as follows: `docker compose -f ~/sandbox/rails/compose.yml pull db`
249+
For example, if you are running the [Compose Rails sample](https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/README.md), and have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like [docker compose pull](/reference/cli/docker/compose/pull.md) to get the postgres image for the `db` service from anywhere by using the `-f` flag as follows: `docker compose -f ~/sandbox/rails/compose.yaml pull db`
250250

251251
Here's the full example:
252252

253253
```console
254-
$ docker compose -f ~/sandbox/rails/compose.yml pull db
254+
$ docker compose -f ~/sandbox/rails/compose.yaml pull db
255255
Pulling db (postgres:latest)...
256256
latest: Pulling from library/postgres
257257
ef0380f84d05: Pull complete
@@ -281,7 +281,7 @@ a few different files:
281281
Start with a base file that defines the canonical configuration for the
282282
services.
283283

284-
`compose.yml`
284+
`compose.yaml`
285285

286286
```yaml
287287
services:
@@ -301,7 +301,7 @@ services:
301301
In this example the development configuration exposes some ports to the
302302
host, mounts our code as a volume, and builds the web image.
303303

304-
`compose.override.yml`
304+
`compose.override.yaml`
305305

306306
```yaml
307307
services:
@@ -329,7 +329,7 @@ When you run `docker compose up` it reads the overrides automatically.
329329
To use this Compose app in a production environment, another override file is created, which might be stored in a different git
330330
repository or managed by a different team.
331331

332-
`compose.prod.yml`
332+
`compose.prod.yaml`
333333

334334
```yaml
335335
services:
@@ -347,12 +347,12 @@ services:
347347
To deploy with this production Compose file you can run
348348

349349
```console
350-
$ docker compose -f compose.yml -f compose.prod.yml up -d
350+
$ docker compose -f compose.yaml -f compose.prod.yaml up -d
351351
```
352352

353353
This deploys all three services using the configuration in
354-
`compose.yml` and `compose.prod.yml` but not the
355-
dev configuration in `compose.override.yml`.
354+
`compose.yaml` and `compose.prod.yaml` but not the
355+
dev configuration in `compose.override.yaml`.
356356

357357
For more information, see [Using Compose in production](../production.md).
358358

0 commit comments

Comments
 (0)