Skip to content

Commit b768232

Browse files
ndeloofglours
authored andcommitted
document (hidden) --tty --interactive flags
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 0968940 commit b768232

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/reference/compose_exec.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ This is the equivalent of `docker exec` targeting a Compose service.
66
With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so
77
you can use a command such as `docker compose exec web sh` to get an interactive prompt.
88

9+
By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec`
10+
command requires passing `--interactive --tty` flags to get the same behavior. Compose also support those two flags
11+
to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to
12+
force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside
13+
a script.
14+
915
### Options
1016

1117
| Name | Type | Default | Description |
@@ -28,3 +34,9 @@ This is the equivalent of `docker exec` targeting a Compose service.
2834

2935
With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so
3036
you can use a command such as `docker compose exec web sh` to get an interactive prompt.
37+
38+
By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec`
39+
command requires passing `--interactive --tty` flags to get the same behavior. Compose also support those two flags
40+
to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to
41+
force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside
42+
a script.

docs/reference/docker_compose_exec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ long: |-
55
66
With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so
77
you can use a command such as `docker compose exec web sh` to get an interactive prompt.
8+
9+
By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec`
10+
command requires passing `--interactive --tty` flags to get the same behavior. Compose also support those two flags
11+
to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to
12+
force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside
13+
a script.
814
usage: docker compose exec [OPTIONS] SERVICE COMMAND [ARGS...]
915
pname: docker compose
1016
plink: docker_compose.yaml

0 commit comments

Comments
 (0)