From 8c8167747e2eea3b218839f9e917fac13f3453ac Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Sat, 20 Sep 2014 17:59:52 -0700 Subject: [PATCH] Cleanup: Fix cli docs: Sorted command headers. Signed-off-by: Andrey Petrov Upstream-commit: 9c74cf01e226e116e5a963fe27da8f6f4cee226f Component: cli --- .../docs/sources/reference/commandline/cli.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/components/cli/docs/sources/reference/commandline/cli.md b/components/cli/docs/sources/reference/commandline/cli.md index 74f1b7b3e5..f3bbcf4112 100644 --- a/components/cli/docs/sources/reference/commandline/cli.md +++ b/components/cli/docs/sources/reference/commandline/cli.md @@ -505,6 +505,36 @@ You'll need two shells for this example. 2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from 12de384bfb10) die 2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from 12de384bfb10) stop +## 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'. + ## export Usage: docker export CONTAINER @@ -1359,36 +1389,6 @@ 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