Browse code

add some more text to the cli docs

Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)

Sven Dowideit authored on 2014/04/07 16:00:01
Showing 1 changed files
... ...
@@ -148,9 +148,14 @@ TMPDIR and the data directory can be set like this:
148 148
       --no-stdin=false: Do not attach stdin
149 149
       --sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
150 150
 
151
+The ``attach`` command will allow you to view or interact with any
152
+running container, detached (``-d``) or interactive (``-i``). You can
153
+attach to the same container at the same time - screen sharing style,
154
+or quickly view the progress of your daemonized process.
155
+
151 156
 You can detach from the container again (and leave it running) with
152
-``CTRL-c`` (for a quiet exit) or ``CTRL-\`` to get a stacktrace of
153
-the Docker client when it quits.  When you detach from the container's
157
+``CTRL-C`` (for a quiet exit) or ``CTRL-\`` to get a stacktrace of
158
+the Docker client when it quits. When you detach from the container's
154 159
 process the exit code will be returned to the client.
155 160
 
156 161
 To stop a container, use ``docker stop``.
... ...
@@ -211,6 +216,8 @@ Examples:
211 211
       --no-cache: Do not use the cache when building the image.
212 212
       --rm=true: Remove intermediate containers after a successful build
213 213
 
214
+Use this command to build Docker images from a ``Dockerfile`` and a "context".
215
+
214 216
 The files at ``PATH`` or ``URL`` are called the "context" of the build.
215 217
 The build process may refer to any of the files in the context, for example when
216 218
 using an :ref:`ADD <dockerfile_add>` instruction.
... ...
@@ -317,6 +324,12 @@ by using the ``git://`` schema.
317 317
       -m, --message="": Commit message
318 318
       -a, --author="": Author (eg. "John Hannibal Smith <hannibal@a-team.com>"
319 319
 
320
+It can be useful to commit a container's file changes or settings into a new image.
321
+This allows you debug a container by running an interactive shell, or to export
322
+a working dataset to another server.
323
+Generally, it is better to use Dockerfiles to manage your images in a documented
324
+and maintainable way.
325
+
320 326
 .. _cli_commit_examples:
321 327
 
322 328
 Commit an existing container
... ...
@@ -562,7 +575,7 @@ Listing the full length image IDs
562 562
     Create an empty filesystem image and import the contents of the tarball
563 563
     (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, then optionally tag it.
564 564
 
565
-At this time, the URL must start with ``http`` and point to a single
565
+URLs must start with ``http`` and point to a single
566 566
 file archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) containing a
567 567
 root filesystem. If you would like to import from a local directory or
568 568
 archive, you can use the ``-`` parameter to take the data from *stdin*.
... ...
@@ -625,6 +638,8 @@ preserved.
625 625
 	Kernel Version: 3.8.0-33-generic
626 626
 	WARNING: No swap limit support
627 627
 
628
+When sending issue reports, please use ``docker version`` and ``docker info`` to
629
+ensure we know how your setup is configured.
628 630
 
629 631
 .. _cli_inspect:
630 632
 
... ...
@@ -788,10 +803,7 @@ Restores both images and tags.
788 788
 
789 789
     -f, --follow=false: Follow log output
790 790
 
791
-The ``docker logs`` command is a convenience which batch-retrieves whatever
792
-logs are present at the time of execution. This does not guarantee execution
793
-order when combined with a ``docker run`` (i.e. your run may not have generated
794
-any logs at the time you execute ``docker logs``).
791
+The ``docker logs`` command batch-retrieves all logs present at the time of execution.
795 792
 
796 793
 The ``docker logs --follow`` command combines ``docker logs`` and ``docker attach``:
797 794
 it will first return all logs from the beginning and then continue streaming
... ...
@@ -839,9 +851,6 @@ Running ``docker ps`` showing 2 linked containers.
839 839
     CONTAINER ID        IMAGE                        COMMAND                CREATED              STATUS              PORTS               NAMES
840 840
     4c01db0b339c        ubuntu:12.04                 bash                   17 seconds ago       Up 16 seconds                           webapp
841 841
     d7886598dbe2        crosbymichael/redis:latest   /redis-server --dir    33 minutes ago       Up 33 minutes       6379/tcp            redis,webapp/db
842
-    fd2645e2e2b5        busybox:latest               top                    10 days ago          Ghost                                   insane_ptolemy
843
-
844
-The last container is marked as a ``Ghost`` container. It is a container that was running when the docker daemon was restarted (upgraded, or ``-H`` settings changed). The container is still running, but as this docker daemon process is not able to manage it, you can't attach to it. To bring them out of ``Ghost`` Status, you need to use ``docker kill`` or ``docker restart``.
845 842
 
846 843
 ``docker ps`` will show only running containers by default.  To see all containers: ``docker ps -a``
847 844
 
... ...
@@ -856,6 +865,23 @@ The last container is marked as a ``Ghost`` container. It is a container that wa
856 856
 
857 857
     Pull an image or a repository from the registry
858 858
 
859
+Most of your images will be created on top of a base image from the
860
+<Docker Index>(https://index.docker.io).
861
+
862
+The Docker Index contains many pre-built images that you can ``pull`` and try 
863
+without needing to define and configure your own.
864
+
865
+To download a particular image, or set of images (i.e., a repository),
866
+use ``docker pull``:
867
+
868
+.. code-block:: bash
869
+
870
+    $ docker pull debian
871
+    # will pull all the images in the debian repository
872
+    $ docker pull debian:testing
873
+    # will pull only the image named debian:testing and any intermediate layers
874
+    # it is based on. (typically the empty `scratch` image, a MAINTAINERs layer,
875
+    # and the un-tared base.
859 876
 
860 877
 .. _cli_push:
861 878
 
... ...
@@ -868,6 +894,7 @@ The last container is marked as a ``Ghost`` container. It is a container that wa
868 868
 
869 869
     Push an image or a repository to the registry
870 870
 
871
+Use ``docker push`` to share your images on public or private registries.
871 872
 
872 873
 .. _cli_restart:
873 874
 
... ...
@@ -926,7 +953,7 @@ network communication.
926 926
 
927 927
 .. code-block:: bash
928 928
 
929
-    $ sudo docker rm `docker ps -a -q`
929
+    $ sudo docker rm $(docker ps -a -q)
930 930
 
931 931
 
932 932
 This command will delete all stopped containers. The command ``docker ps -a -q`` will return all
... ...
@@ -1022,7 +1049,8 @@ The ``docker run`` command first ``creates`` a writeable container layer over
1022 1022
 the specified image, and then ``starts`` it using the specified command. That
1023 1023
 is, ``docker run`` is equivalent to the API ``/containers/create`` then
1024 1024
 ``/containers/(id)/start``.
1025
-Once the container is stopped it still exists and can be started back up.  See ``docker ps -a`` to view a list of all containers.
1025
+A stopped container can be restarted with all its previous changes intact using 
1026
+``docker start``. See ``docker ps -a`` to view a list of all containers.
1026 1027
 
1027 1028
 The ``docker run`` command can be used in combination with ``docker commit`` to
1028 1029
 :ref:`change the command that a container runs <cli_commit_examples>`.
... ...
@@ -1270,6 +1298,8 @@ This example shows 5 containers that might be set up to test a web application c
1270 1270
 Produces a tarred repository to the standard output stream.
1271 1271
 Contains all parent layers, and all tags + versions, or specified repo:tag.
1272 1272
 
1273
+It is used to create a backup that can then be used with ``docker load``
1274
+
1273 1275
 .. code-block:: bash
1274 1276
 
1275 1277
    $ sudo docker save busybox > busybox.tar
... ...
@@ -1297,6 +1327,9 @@ Contains all parent layers, and all tags + versions, or specified repo:tag.
1297 1297
      -s, --stars=0: Only displays with at least xxx stars
1298 1298
      -t, --trusted=false: Only show trusted builds
1299 1299
 
1300
+See :ref:`searching_central_index` for more details on finding shared images
1301
+from the commandline.
1302
+
1300 1303
 .. _cli_start:
1301 1304
 
1302 1305
 ``start``
... ...
@@ -1339,6 +1372,9 @@ The main process inside the container will receive SIGTERM, and after a grace pe
1339 1339
 
1340 1340
       -f, --force=false: Force
1341 1341
 
1342
+You can group your images together using names and
1343
+tags, and then upload them to :ref:`working_with_the_repository`.
1344
+
1342 1345
 .. _cli_top:
1343 1346
 
1344 1347
 ``top``