@@ -6,6 +6,12 @@ This is the equivalent of `docker exec` targeting a Compose service.
6
6
With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so
7
7
you can use a command such as ` docker compose exec web sh ` to get an interactive prompt.
8
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.
14
+
9
15
### Options
10
16
11
17
| Name | Type | Default | Description |
@@ -28,3 +34,9 @@ This is the equivalent of `docker exec` targeting a Compose service.
28
34
29
35
With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so
30
36
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.
0 commit comments