Browse code

Cleanup: Fix cli docs: Sorted command headers.

Signed-off-by: Andrey Petrov <andrey.petrov@shazow.net>

Andrey Petrov authored on 2014/09/21 09:59:52
Showing 1 changed files
... ...
@@ -505,6 +505,36 @@ You'll need two shells for this example.
505 505
     2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from 12de384bfb10) die
506 506
     2014-09-03T15:49:29.999999999Z07:00 4386fb97867d: (from 12de384bfb10) stop
507 507
 
508
+## exec
509
+
510
+    Usage: docker exec CONTAINER COMMAND [ARG...]
511
+
512
+    Run a command in an existing container
513
+
514
+      -d, --detach=false         Detached mode: run the process in the background and exit
515
+      -i, --interactive=false    Keep STDIN open even if not attached
516
+      -t, --tty=false            Allocate a pseudo-TTY
517
+
518
+The `docker exec` command runs a user specified command as a new process in an existing
519
+user specified container. The container needs to be active.
520
+
521
+The `docker exec` command will typically be used after `docker run`.
522
+
523
+### Examples:
524
+
525
+    $ sudo docker run --name ubuntu_bash --rm -i -t ubuntu bash
526
+
527
+This will create a container named 'ubuntu_bash' and start a bash session.
528
+
529
+    $ sudo docker exec -d ubuntu_bash touch /tmp/execWorks
530
+
531
+This will create a new file '/tmp/execWorks' inside the existing and active container
532
+'ubuntu_bash', in the background.
533
+
534
+    $ sudo docker exec ubuntu_bash -it bash
535
+
536
+This will create a new bash session in the container 'ubuntu_bash'.
537
+
508 538
 ## export
509 539
 
510 540
     Usage: docker export CONTAINER
... ...
@@ -1359,36 +1389,6 @@ It is even useful to cherry-pick particular tags of an image repository
1359 1359
 
1360 1360
    $ sudo docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy
1361 1361
 
1362
-## exec
1363
-
1364
-    Usage: docker exec CONTAINER COMMAND [ARG...]
1365
-
1366
-    Run a command in an existing container
1367
-
1368
-      -d, --detach=false         Detached mode: run the process in the background and exit
1369
-      -i, --interactive=false    Keep STDIN open even if not attached
1370
-      -t, --tty=false            Allocate a pseudo-TTY
1371
-
1372
-The `docker exec` command runs a user specified command as a new process in an existing
1373
-user specified container. The container needs to be active.
1374
-
1375
-The `docker exec` command will typically be used after `docker run`.
1376
-
1377
-### Examples:
1378
-
1379
-    $ sudo docker run --name ubuntu_bash --rm -i -t ubuntu bash
1380
-
1381
-This will create a container named 'ubuntu_bash' and start a bash session.
1382
-
1383
-    $ sudo docker exec -d ubuntu_bash touch /tmp/execWorks
1384
-
1385
-This will create a new file '/tmp/execWorks' inside the existing and active container
1386
-'ubuntu_bash', in the background.
1387
-
1388
-    $ sudo docker exec ubuntu_bash -it bash
1389
-
1390
-This will create a new bash session in the container 'ubuntu_bash'.
1391
-
1392 1362
 ## search
1393 1363
 
1394 1364
 Search [Docker Hub](https://hub.docker.com) for images