Files
docker-docs/compose/reference/exec.md
John Mulhausen 558314bf56 Converges titles to imperative-form, front-matter based, and sentence-case (#438)
Multiple title fixes, consistency fixes, convergence into metadata-based titles.
2016-11-04 15:38:40 -07:00

841 B

description, keywords, title
description keywords title
docker-compose exec
fig, composition, compose, docker, orchestration, cli, exec
docker-compose exec
Usage: exec [options] SERVICE COMMAND [ARGS...]

Options:
-d                Detached mode: Run command in the background.
--privileged      Give extended privileges to the process.
--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 do e.g. docker-compose exec web sh to get an interactive prompt.