Adding docker exec support in CLI.

Fixed a bug in daemon that resulted in accessing of a closed pipe.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
This commit is contained in:
Vishnu Kannan
2014-09-16 19:24:25 +00:00
parent 39030382c4
commit c786a8ee5e
9 changed files with 208 additions and 35 deletions
+29
View File
@@ -0,0 +1,29 @@
% DOCKER(1) Docker User Manuals
% Docker Community
% SEPT 2014
# NAME
docker-exec - Run a command in an existing container
# SYNOPSIS
**docker exec**
[**-d**|**--detach**[=*false*]]
[**-i**|**--interactive**[=*false*]]
[**-t**|**--tty**[=*false*]]
CONTAINER COMMAND [ARG...]
# DESCRIPTION
Run a process in an existing container. The existing CONTAINER needs to be active.
# Options
**-d**, **--detach**=*true*|*false*
Detached mode. This runs the new process in the background.
**-i**, **--interactive**=*true*|*false*
When set to true, keep STDIN open even if not attached. The default is false.
**-t**, **--tty**=*true*|*false*
When set to true Docker can allocate a pseudo-tty and attach to the standard
input of the process. This can be used, for example, to run a throwaway
interactive shell. The default value is false.
+30
View File
@@ -1295,6 +1295,36 @@ It is even useful to cherry-pick particular tags of an image repository
$ sudo docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
## exec
Usage: docker exec CONTAINER COMMAND [ARG...]
Run a command in an existing container
-d, --detach=false Detached mode: run the process in the background and exit
-i, --interactive=false Keep STDIN open even if not attached
-t, --tty=false Allocate a pseudo-TTY
The `docker exec` command runs a user specified command as a new process in an existing
user specified container. The container needs to be active.
The `docker exec` command will typically be used after `docker run`.
### Examples:
$ sudo docker run --name ubuntu_bash --rm -i -t ubuntu bash
This will create a container named 'ubuntu_bash' and start a bash session.
$ sudo docker exec -d ubuntu_bash touch /tmp/execWorks
This will create a new file '/tmp/execWorks' inside the existing and active container
'ubuntu_bash', in the background.
$ sudo docker exec ubuntu_bash -it bash
This will create a new bash session in the container 'ubuntu_bash'.
## search
Search [Docker Hub](https://hub.docker.com) for images