From 3ac4c78850b1ae0e6f8484ad4d56d0a080b7360e Mon Sep 17 00:00:00 2001 From: Patrick Hensley Date: Sat, 18 Oct 2014 11:45:59 -0400 Subject: [PATCH] Updated README with description of exec. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 52139b21..e4452071 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,26 @@ c.diff(container) Identical to the `docker diff` command. +```python +c.exec(container, cmd, detach=False, stdout=True, stderr=True, + stream=False, tty=False) +``` + +Execute a command in a running container. + +The `container` argument can be a container dictionary (result of +running `inspect_container`), unique id or container name. + +The `cmd` argument must be a `list` or `tuple`, representing the command +and its arguments. Example `['ls', '-la']`. + +Setting the `detach` flag to `True` will run the process in the background. + +The `stdout` and `stderr` flags indicate which output streams to read from. + +The `stream` flag indicates whether to return a generator which will yield +the streaming response in chunks. + ```python c.export(container) ```