Get Started
Quickstart containers Understand the architecture
Migrate to Engine 1.10 Breaking changes Deprecated Engine Features FAQ
Release Notes
Back up data volumes Create a proxy or load balancer Install the Deploy to Docker Cloud button Integrate with Slack Link to a source code repository Push images to Docker Cloud SSHing into a Docker Cloud-managed node Upgrade Docker Engine on a node Use the Docker Cloud Agent Using the Docker Cloud CLI
API reference
Quickstart contribution FAQ for contributors Where to chat or get help Style guide for Docker documentation

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.

On this page:
Apr 13, 2016 at 5:49pm (PST) { "docker/apidocs": { "ref": "docs", "repos": [ "git@github.com:docker/dhe-deploy.git" ], "sha": "ca759a68a914496aa6093a7f43c6e0b82bada4a6" }, "docker/cloud-api-docs": { "ref": "master", "repos": [ "git@github.com:docker/cloud-docs.git" ], "sha": "7e32c2dfbecf6ebfec361fa547c5efae1f84e76f" }, "docker/cloud-api-docs-layout": { "ref": "master", "repos": [ "git@github.com:docker/cloud-docs.git" ], "sha": "7e32c2dfbecf6ebfec361fa547c5efae1f84e76f" }, "docker/compose": { "ref": "docs", "repos": [ "git@github.com:docker/compose.git" ], "sha": "1126e2a57a0fac01d4c789116ea5f2ccf392c880" }, "docker/docker": { "ref": "docs", "repos": [ "git@github.com:docker/docker.git" ], "sha": "0e63b073ac8f33335a4d4df3f2aa22120e0b7f43" }, "docker/docker-cloud": { "ref": "master", "repos": [ "git@github.com:docker/cloud-docs.git" ], "sha": "7e32c2dfbecf6ebfec361fa547c5efae1f84e76f" }, "docker/docker-hub": { "ref": "master", "repos": [ "git@github.com:docker/hub2-demo.git" ], "sha": "9564a8db74a651c915c158c73e7f2b753c45a3d6" }, "docker/docker-trusted-registry": { "ref": "docs", "repos": [ "git@github.com:docker/dhe-deploy.git" ], "sha": "ca759a68a914496aa6093a7f43c6e0b82bada4a6" }, "docker/docs-base": { "ref": "master", "repos": [ "git@github.com:docker/docs-base.git" ], "sha": "095e706cba00f72984bd71d5d6f630d8fda9ea92" }, "docker/kitematic": { "ref": "master", "repos": [ "git@github.com:docker/kitematic.git" ], "sha": "db05a00ba13eff9a4930844d35129c5470ae518c" }, "docker/machine": { "ref": "docs", "repos": [ "git@github.com:docker/machine.git" ], "sha": "5239e6ed039e21993d164d950ef285eeff98e5b5" }, "docker/notary": { "ref": "docs", "repos": [ "git@github.com:docker/notary.git" ], "sha": "dfeb51f54f2b0cdf20cb55427b7cc8ea2d1cdd0a" }, "docker/opensource": { "ref": "master", "repos": [ "git@github.com:docker/opensource.git" ], "sha": "9dd45b421c833e5458869bcec6afa8f635e8cff4" }, "docker/registry": { "ref": "docs", "repos": [ "git@github.com:docker/distribution.git" ], "sha": "e90ff92895eaa7ea693275c8f348357ed66b8473" }, "docker/swarm": { "ref": "docs", "repos": [ "git@github.com:docker/swarm.git" ], "sha": "a6c1f1463c1b39786cfdd5700b820f0c42034942" }, "docker/toolbox": { "ref": "master", "repos": [ "git@github.com:docker/toolbox.git" ], "sha": "d093888578745cd7e1df5bc03add8ca737c95f60" }, "docker/tutorials": { "ref": "master", "repos": [ "git@github.com:docker/tutorials.git" ], "sha": "26d7781af8f4ee2cd4a5e4f12238431c3a31501c" }, "docker/ucp": { "ref": "docs", "repos": [ "git@github.com:docker/orca.git" ], "sha": "03ffe9856b44521684355758b5ffb3cfe093d3a4" }, "docs.docker.com": { "ref": "refs/heads/ucp-interim", "repos": [ "git@github.com:moxiegirl/docs.docker.com.git", "git@github.com:docker/docs.docker.com.git" ], "sha": "713fa140149f2be727da25db678a76832c88c806" } }