Fixed a lot of language and small things.

This commit is contained in:
Thatcher Peskens 2013-04-01 19:11:09 -07:00
parent f15889461d
commit 81874ad442
7 changed files with 80 additions and 79 deletions

View File

@ -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 <path to>/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 <container_id> <some_name>
# 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 <container_id>
However, it is probably more useful to commit it to a specific name
::
docker commit <container_id> <your username>/some_name
Read more about :ref:`working_with_the_repository` or continue to the complete :ref:`cli`

View File

@ -2,6 +2,7 @@
:description: Docker's CLI command description and usage
:keywords: Docker, Docker documentation, CLI, command line
.. _cli:
Command Line Interface
======================

View File

@ -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 <container_id>
However, it is probably more useful to commit it to a specific name
::
docker commit <container_id> <your username>/some_name
# for example docker commit $CONTAINER_ID dhrp/kickassapp
docker commit <container_id> <your username>/<some_name>
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 <container_id> 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 <image-name>

View File

@ -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

View File

@ -79,11 +79,3 @@ See the example in action
</div>
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``

View File

@ -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.

View File

@ -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.