Uh oh!
There was an error while loading. Please reload this page.
Added "docker exec" command for a service or all services. - #1180
Added "docker exec" command for a service or all services. #1180osteenbergen wants to merge 2 commits into
Conversation
Example: $ docker-compose execute web echo "Hello World!" Supports --detach for background running Supports running command on all containers with: $ docker-compose execute all echo "Hello World!" Signed-off-by: Onno Steenbergen <onno@steenbe.nl>
ghost
commented
Mar 26, 2015
That sounds awesome, +1 for merging it! |
Vrakfall
commented
Mar 26, 2015
+1 |
aanand
commented
Mar 26, 2015
Thanks for contributing!
|
aanand
commented
Mar 26, 2015
Oh, and:
|
osteenbergen
commented
Mar 27, 2015
Aanan, thanks for your comments and I will integrate them as soon as possible
|
ghost
commented
Mar 27, 2015
Agree that interactive is a little weird. I understand that docker images with SSH are not really the way to go, but if you really want interactivity on multiple machines, something like SSH + clusterssh (or similar projects) are probably the way to go. |
all is now an options (--all) Renamed long_running to long-running so all folders have the same name convention exec is a python reserved word so needed to change docopt_command to allow for reserved words. Signed-off-by: Onno Steenbergen <onno@steenbe.nl>
osteenbergen
commented
Mar 27, 2015
Point 1 & 2 are integrated. It seems that the Jenkins build bot has an error. About the commit itself: Due to the way docopt works my only way to have --all was to write the usage line as Other combinations ( |
aanand
commented
Mar 27, 2015
I think that if there are multiple containers for a service running, Compose should either refuse to run Thinking about it, |
osteenbergen
commented
Mar 28, 2015
I do not agree that The idea is to have a service (or system with --all) in a predictable state, executing a command on a single worker could result in different behaviour. Over time this will lead to an unstable system. The use-case of I agree that there aren't many use cases, but we can't predict the usage of compose. Maybe some user like to have an arbitrary container, which can be solved by a For parsing the output we could add a output folder option. This will create a separate file for every container running in the service/system. |
aanand
commented
Mar 30, 2015
I can believe there are a few good use cases for running an But Compose isn't (yet) a tool for production environments, and so there isn't a strong need for that feature now. What would be useful, right now, is a command for inspecting a running container - an analogue to |
osteenbergen
commented
Mar 31, 2015
Will work on that (need to add support for exec in dockerpty). As soon as that is finished and pulled I will update this pull. |
mattes
commented
Apr 23, 2015
+1 |
mcortinas
commented
Sep 15, 2015
+1 |
1 similar comment
antono
commented
Oct 30, 2015
+1 |
aanand
commented
Dec 17, 2015
Closing as #2023 is the direction we're going in - thanks for the PR! |
Example:
Supports --detach for background running
Supports running command on all containers with: