mirror of
https://github.com/docker/docs.git
synced 2026-03-28 23:08:49 +07:00
* Reword lots of instances of 'will' * Reword lots of instances of won't * Reword lots of instances of we'll * Eradicate you'll * Eradicate 'be able to' type of phrases * Eradicate 'unable to' type of phrases * Eradicate 'has / have to' type of phrases * Eradicate 'note that' type of phrases * Eradicate 'in order to' type of phrases * Redirect to official Chef and Puppet docs * Eradicate gratuitous 'please' * Reduce use of e.g. * Reduce use of i.e. * Reduce use of N.B. * Get rid of 'sexagesimal' and correct some errors
24 lines
864 B
Markdown
24 lines
864 B
Markdown
---
|
|
description: docker-compose exec
|
|
keywords: fig, composition, compose, docker, orchestration, cli, exec
|
|
title: docker-compose exec
|
|
notoc: true
|
|
---
|
|
|
|
```
|
|
Usage: exec [options] SERVICE COMMAND [ARGS...]
|
|
|
|
Options:
|
|
-d Detached mode: Run command in the background.
|
|
--privileged Give extended privileges to the process.
|
|
-u, --user USER Run the command as this user.
|
|
-T Disable pseudo-tty allocation. By default `docker-compose exec`
|
|
allocates a TTY.
|
|
--index=index index of the container if there are multiple
|
|
instances of a service [default: 1]
|
|
```
|
|
|
|
This is equivalent of `docker exec`. With this subcommand you can run arbitrary
|
|
commands in your services. Commands are by default allocating a TTY, so you can
|
|
use a command such as `docker-compose exec web sh` to get an interactive prompt.
|