From 81874ad4425ed1a3520944bfcced271041e7b0f4 Mon Sep 17 00:00:00 2001 From: Thatcher Peskens Date: Mon, 1 Apr 2013 19:11:09 -0700 Subject: [PATCH] Fixed a lot of language and small things. --- docs/sources/commandline/basics.rst | 58 +++++++++++-------- docs/sources/commandline/cli.rst | 1 + .../commandline/workingwithrepository.rst | 32 ++++------ docs/sources/examples/hello_world.rst | 4 +- docs/sources/examples/hello_world_daemon.rst | 8 --- docs/sources/faq.rst | 46 +++++++-------- docs/sources/installation/ubuntulinux.rst | 10 +++- 7 files changed, 80 insertions(+), 79 deletions(-) diff --git a/docs/sources/commandline/basics.rst b/docs/sources/commandline/basics.rst index 0319796742..5da2012da5 100644 --- a/docs/sources/commandline/basics.rst +++ b/docs/sources/commandline/basics.rst @@ -6,6 +6,21 @@ The basics ============= +Starting Docker +--------------- + +If you have used one of the quick install paths', Docker may have been installed with upstart, Ubuntu's +system for starting processes at boot time. You should be able to run ``docker help`` and get output. + +If you get ``docker: command not found`` or something like ``/var/lib/docker/repositories: permission denied`` +you will need to specify the path to it and manually start it. + +.. code-block:: bash + + # Run docker in daemon mode + sudo /docker -d & + + Running an interactive shell ---------------------------- @@ -24,9 +39,6 @@ Starting a long-running worker process .. code-block:: bash - # Run docker in daemon mode - (sudo docker -d || echo "Docker daemon already running") & - # Start a very useful long-running process JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done") @@ -56,33 +68,33 @@ Expose a service on a TCP port PORT=$(docker port $JOB 4444) # Connect to the public port via the host's public address + # Please note that because of how routing works connecting to localhost or 127.0.0.1 $PORT will not work. echo hello world | nc $(hostname) $PORT # Verify that the network connection worked echo "Daemon received: $(docker logs $JOB)" -Continue to the complete `Command Line Interface`_ -.. _Command Line Interface: ../commandline/cli.html +Committing (saving) an image +----------------------------- + +Save your containers state to a container image, so the state can be re-used. + +When you commit your container only the differences between the image the container was created from +and the current state of the container will be stored (as a diff). See which images you already have +using ``docker images`` + +.. code-block:: bash + + # Commit your container to a new named image + docker commit + + # List your containers + docker images + +You now have a image state from which you can create new instances. -Committing an image ---------------------- - -Committing your container to an (named) image is useful because this way it can be re-used. Compare it to creating -a virtual machine image. Except your containers will generally be shorted lived so saving (committing) the state of -it is more important. - -The state of a container can be saved at any time by running - -:: - - docker commit - -However, it is probably more useful to commit it to a specific name - -:: - - docker commit /some_name +Read more about :ref:`working_with_the_repository` or continue to the complete :ref:`cli` diff --git a/docs/sources/commandline/cli.rst b/docs/sources/commandline/cli.rst index 79c190f808..2d3e9c7ae1 100644 --- a/docs/sources/commandline/cli.rst +++ b/docs/sources/commandline/cli.rst @@ -2,6 +2,7 @@ :description: Docker's CLI command description and usage :keywords: Docker, Docker documentation, CLI, command line +.. _cli: Command Line Interface ====================== diff --git a/docs/sources/commandline/workingwithrepository.rst b/docs/sources/commandline/workingwithrepository.rst index 90ac4aef99..ae749fdb03 100644 --- a/docs/sources/commandline/workingwithrepository.rst +++ b/docs/sources/commandline/workingwithrepository.rst @@ -1,4 +1,4 @@ - +.. _working_with_the_repository: Working with the repository ============================ @@ -8,7 +8,7 @@ Connecting to the repository You create a user on the central docker repository by running -:: +.. code-block:: bash docker login @@ -20,33 +20,23 @@ automatically log you in. Committing a container to a named image --------------------------------------- -Committing containers to named images is not only usefull when committing to the repository. But in order to commit to -the repository it is required to have an image with your namespace. +In order to commit to the repository it is required to have committed your container to an image with your namespace. -The state of a container can be saved at any time by running +.. code-block:: bash -:: - - docker commit - -However, it is probably more useful to commit it to a specific name - -:: - - docker commit /some_name + # for example docker commit $CONTAINER_ID dhrp/kickassapp + docker commit / -Committing a container to the repository +Pushing a container to the repository ----------------------------------------- -In order to push an image to the repository you need to have committed your container to a named image including your -repository username. e.g. by doing: docker commit dhrp/nodejs +In order to push an image to the repository you need to have committed your container to a named image (see above) Now you can commit this image to the repository -:: +.. code-block:: bash - docker push image-name - - # for example docker push dhrp/nodejs + # for example docker push dhrp/kickassapp + docker push diff --git a/docs/sources/examples/hello_world.rst b/docs/sources/examples/hello_world.rst index f6387d487e..f7d455f803 100644 --- a/docs/sources/examples/hello_world.rst +++ b/docs/sources/examples/hello_world.rst @@ -6,9 +6,7 @@ Hello World =========== -This is the most basic example available for using docker - -This example assumes you have Docker installed. +This is the most basic example available for using Docker. The example assumes you have Docker installed. Download the base container diff --git a/docs/sources/examples/hello_world_daemon.rst b/docs/sources/examples/hello_world_daemon.rst index f9c71fbacb..8453952058 100644 --- a/docs/sources/examples/hello_world_daemon.rst +++ b/docs/sources/examples/hello_world_daemon.rst @@ -79,11 +79,3 @@ See the example in action Continue to the :ref:`python_web_app` example. - - -Notes: ------- - -- **Docker daemon** The docker daemon is started by ``sudo docker -d``, Vagrant may have started - the Docker daemon for you, but you will need to restart it this way if it was terminated. Otherwise - it may give you ``Couldn't create Tag store: open /var/lib/docker/repositories: permission denied`` diff --git a/docs/sources/faq.rst b/docs/sources/faq.rst index 03d584879d..51fc00b306 100644 --- a/docs/sources/faq.rst +++ b/docs/sources/faq.rst @@ -5,43 +5,43 @@ FAQ Most frequently asked questions. -------------------------------- -**1. How much does Docker cost?** +1. **How much does Docker cost?** -Docker is 100% free, it is open source, so you can use it without paying. + Docker is 100% free, it is open source, so you can use it without paying. -**2. What open source license are you using?** +2. **What open source license are you using?** -We are using the Apache License Version 2.0, see it here: https://github.com/dotcloud/docker/blob/master/LICENSE + We are using the Apache License Version 2.0, see it here: https://github.com/dotcloud/docker/blob/master/LICENSE -**3. Does Docker run on Mac OS X or Windows?** +3. **Does Docker run on Mac OS X or Windows?** -Not at this time, Docker currently only runs on Linux, but you can use VirtualBox to run Docker in a virtual machine on your box, and get the best of both worlds. Check out the MacOSX_ and Windows_ intallation guides. + Not at this time, Docker currently only runs on Linux, but you can use VirtualBox to run Docker in a virtual machine on your box, and get the best of both worlds. Check out the MacOSX_ and Windows_ intallation guides. -**4. How do containers compare to virtual machines?** +4. **How do containers compare to virtual machines?** -They are complementary. VMs are best used to allocate chunks of hardware resources. Containers operate at the process level, which makes them very lightweight and perfect as a unit of software delivery. + They are complementary. VMs are best used to allocate chunks of hardware resources. Containers operate at the process level, which makes them very lightweight and perfect as a unit of software delivery. -**5. Can I help by adding some questions and answers?** +5. **Can I help by adding some questions and answers?** -Definitely! You can fork `the repo`_ and edit the documentation sources. + Definitely! You can fork `the repo`_ and edit the documentation sources. -**42. Where can I find more answers?** +42. **Where can I find more answers?** -You can find more answers on: + You can find more answers on: -* `IRC: docker on freenode`_ -* `Github`_ -* `Ask questions on Stackoverflow`_ -* `Join the conversation on Twitter`_ + * `IRC: docker on freenode`_ + * `Github`_ + * `Ask questions on Stackoverflow`_ + * `Join the conversation on Twitter`_ -.. _Windows: ../documentation/installation/windows.html -.. _MacOSX: ../documentation/installation/macos.html -.. _the repo: http://www.github.com/dotcloud/docker -.. _IRC\: docker on freenode: irc://chat.freenode.net#docker -.. _Github: http://www.github.com/dotcloud/docker -.. _Ask questions on Stackoverflow: http://stackoverflow.com/search?q=docker -.. _Join the conversation on Twitter: http://twitter.com/getdocker + .. _Windows: ../documentation/installation/windows.html + .. _MacOSX: ../documentation/installation/macos.html + .. _the repo: http://www.github.com/dotcloud/docker + .. _IRC\: docker on freenode: irc://chat.freenode.net#docker + .. _Github: http://www.github.com/dotcloud/docker + .. _Ask questions on Stackoverflow: http://stackoverflow.com/search?q=docker + .. _Join the conversation on Twitter: http://twitter.com/getdocker Looking for something else to read? Checkout the :ref:`hello_world` example. diff --git a/docs/sources/installation/ubuntulinux.rst b/docs/sources/installation/ubuntulinux.rst index 6c2a4fa52b..bf83a5bc88 100644 --- a/docs/sources/installation/ubuntulinux.rst +++ b/docs/sources/installation/ubuntulinux.rst @@ -42,7 +42,15 @@ Run your first container! sudo ./docker run -i -t base /bin/bash + +To run docker as a daemon, in the background, and allow non-root users to run ``docker`` start +docker -d + +:: + + sudo ./docker -d & + + Consider adding docker to your PATH for simplicity. - Continue with the :ref:`hello_world` example. \ No newline at end of file