Skip to content
Closed
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 _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exclude:
latest_engine_api_version: "1.42"
docker_ce_version: "23.0.0"
compose_v1_version: "1.29.2"
compose_version: "v2.15.1"
compose_version: "v2.16.0"
compose_file_v3: "3.9"
compose_file_v2: "2.4"
machine_version: "0.16.0"
Expand Down
25 changes: 22 additions & 3 deletions _data/compose-cli/docker_compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,22 @@ long: |-

Profiles can also be set by `COMPOSE_PROFILES` environment variable.

### Configuring parallelism

Use `--parallel` to specify the maximum level of parallelism for concurrent engine calls.
Calling `docker compose --parallel 1 pull` will pull the pullable images defined in the Compose file
one at a time. This can also be used to control build concurrency.

Parallelism can also be set by the `COMPOSE_PARALLEL_LIMIT` environment variable.

### Set up environment variables

You can set environment variables for various docker compose options, including the `-f`, `-p` and `--profiles` flags.

Setting the `COMPOSE_FILE` environment variable is equivalent to passing the `-f` flag,
`COMPOSE_PROJECT_NAME` environment variable does the same as the `-p` flag,
and `COMPOSE_PROFILES` environment variable is equivalent to the `--profiles` flag.
`COMPOSE_PROFILES` environment variable is equivalent to the `--profiles` flag
and `COMPOSE_PARALLEL_LIMIT` does the same as the `--parallel` flag.

If flags are explicitly set on the command line, the associated environment variable is ignored.

Expand All @@ -106,7 +115,7 @@ pname: docker
plink: docker.yaml
cname:
- docker compose build
- docker compose convert
- docker compose config
- docker compose cp
- docker compose create
- docker compose down
Expand All @@ -132,7 +141,7 @@ cname:
- docker compose version
clink:
- docker_compose_build.yaml
- docker_compose_convert.yaml
- docker_compose_config.yaml
- docker_compose_cp.yaml
- docker_compose_create.yaml
- docker_compose_down.yaml
Expand Down Expand Up @@ -178,6 +187,16 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: dry-run
value_type: bool
default_value: "false"
description: Execute command in dry run mode
deprecated: false
hidden: true
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: env-file
value_type: string
description: Specify an alternate environment file.
Expand Down
17 changes: 17 additions & 0 deletions _data/compose-cli/docker_compose_alpha.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
command: docker compose alpha
short: Experimental commands
long: Experimental commands
pname: docker compose
plink: docker_compose.yaml
cname:
- docker compose alpha dry-run
- docker compose alpha watch
clink:
- docker_compose_alpha_dry-run.yaml
- docker_compose_alpha_watch.yaml
deprecated: false
experimental: false
experimentalcli: true
kubernetes: false
swarm: false

14 changes: 14 additions & 0 deletions _data/compose-cli/docker_compose_alpha_dry-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
command: docker compose alpha dry-run
short: |
EXPERIMENTAL - Dry run command allow you to test a command without applying changes
long: |
EXPERIMENTAL - Dry run command allow you to test a command without applying changes
usage: docker compose alpha dry-run -- [COMMAND...]
pname: docker compose alpha
plink: docker_compose_alpha.yaml
deprecated: false
experimental: false
experimentalcli: true
kubernetes: false
swarm: false

25 changes: 25 additions & 0 deletions _data/compose-cli/docker_compose_alpha_watch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
command: docker compose alpha watch
short: |
EXPERIMENTAL - Watch build context for service and rebuild/refresh containers when files are updated
long: |
EXPERIMENTAL - Watch build context for service and rebuild/refresh containers when files are updated
usage: docker compose alpha watch [SERVICE...]
pname: docker compose alpha
plink: docker_compose_alpha.yaml
options:
- option: quiet
value_type: bool
default_value: "false"
description: hide build output
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
experimental: false
experimentalcli: true
kubernetes: false
swarm: false

10 changes: 10 additions & 0 deletions _data/compose-cli/docker_compose_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: push
value_type: bool
default_value: "false"
description: Push service images.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: quiet
shorthand: q
value_type: bool
Expand Down
138 changes: 138 additions & 0 deletions _data/compose-cli/docker_compose_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
command: docker compose config
aliases: docker compose config, docker compose convert
short: Parse, resolve and render compose file in canonical format
long: |-
`docker compose config` renders the actual data model to be applied on the Docker engine.
it merges the Compose files set by `-f` flags, resolves variables in the Compose file, and expands short-notation into
the canonical format.
usage: docker compose config [OPTIONS] [SERVICE...]
pname: docker compose
plink: docker_compose.yaml
options:
- option: format
value_type: string
default_value: yaml
description: 'Format the output. Values: [yaml | json]'
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: hash
value_type: string
description: Print the service config hash, one per line.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: images
value_type: bool
default_value: "false"
description: Print the image names, one per line.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: no-consistency
value_type: bool
default_value: "false"
description: |
Don't check model consistency - warning: may produce invalid Compose output
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: no-interpolate
value_type: bool
default_value: "false"
description: Don't interpolate environment variables.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: no-normalize
value_type: bool
default_value: "false"
description: Don't normalize compose model.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: output
shorthand: o
value_type: string
description: Save to file (default to stdout)
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: profiles
value_type: bool
default_value: "false"
description: Print the profile names, one per line.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: quiet
shorthand: q
value_type: bool
default_value: "false"
description: Only validate the configuration, don't print anything.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: resolve-image-digests
value_type: bool
default_value: "false"
description: Pin image tags to digests.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: services
value_type: bool
default_value: "false"
description: Print the service names, one per line.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: volumes
value_type: bool
default_value: "false"
description: Print the volume names, one per line.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false

21 changes: 21 additions & 0 deletions _data/compose-cli/docker_compose_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: remove-orphans
value_type: bool
default_value: "false"
description: Remove containers for services not defined in the Compose file.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: scale
value_type: stringArray
default_value: '[]'
description: |
Scale SERVICE to NUM instances. Overrides the `scale` setting in the Compose file if present.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
deprecated: false
experimental: false
experimentalcli: false
Expand Down
1 change: 1 addition & 0 deletions _data/compose-cli/docker_compose_logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ options:
kubernetes: false
swarm: false
- option: tail
shorthand: "n"
value_type: string
default_value: all
description: |
Expand Down
31 changes: 17 additions & 14 deletions _data/compose-cli/docker_compose_ps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ command: docker compose ps
short: List containers
long: |-
Lists containers for a Compose project, with current status and exposed ports.
By default, both running and stopped containers are shown:

```console
$ docker compose ps
NAME COMMAND SERVICE STATUS PORTS
example-bar-1 "/docker-entrypoint.…" bar exited (0)
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
```

By default, only running containers are shown. `--all` flag can be used to include stopped containers

```console
$ docker compose ps --all
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
```
usage: docker compose ps [OPTIONS] [SERVICE...]
pname: docker compose
Expand Down Expand Up @@ -139,12 +146,12 @@ examples: |-

```console
$ docker compose ps --status=running
NAME COMMAND SERVICE STATUS PORTS
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp

$ docker compose ps --status=exited
NAME COMMAND SERVICE STATUS PORTS
example-bar-1 "/docker-entrypoint.…" bar exited (0)
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited (0)
```

### Filter containers by status (--filter) {#filter}
Expand All @@ -155,12 +162,8 @@ examples: |-

```console
$ docker compose ps --filter status=running
NAME COMMAND SERVICE STATUS PORTS
example-foo-1 "/docker-entrypoint.…" foo running 0.0.0.0:8080->80/tcp

$ docker compose ps --filter status=running
NAME COMMAND SERVICE STATUS PORTS
example-bar-1 "/docker-entrypoint.…" bar exited (0)
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
example-foo-1 alpine "/entrypoint.…" foo 4 seconds ago Up 2 seconds 0.0.0.0:8080->80/tcp
```

The `docker compose ps` command currently only supports the `--filter status=<status>`
Expand Down
10 changes: 10 additions & 0 deletions _data/compose-cli/docker_compose_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ options:
experimentalcli: false
kubernetes: false
swarm: false
- option: remove-orphans
value_type: bool
default_value: "false"
description: Remove containers for services not defined in the Compose file.
deprecated: false
hidden: false
experimental: false
experimentalcli: false
kubernetes: false
swarm: false
- option: rm
value_type: bool
default_value: "false"
Expand Down