Browse code

Merged dhrp/docs

Solomon Hykes authored on 2013/04/03 10:39:39
Showing 18 changed files
1 1
deleted file mode 100644
... ...
@@ -1,67 +0,0 @@
1
-:title: Base commands
2
-:description: Common usage and commands
3
-:keywords: Examples, Usage
4
-
5
-
6
-Base commands
7
-=============
8
-
9
-
10
-Running an interactive shell
11
-
12
-.. code-block:: bash
13
-
14
-  # Download a base image
15
-  docker pull base
16
-
17
-  # Run an interactive shell in the base image,
18
-  # allocate a tty, attach stdin and stdout
19
-  docker run -i -t base /bin/bash
20
-
21
-
22
-Starting a long-running worker process
23
-
24
-.. code-block:: bash
25
-
26
-  # Run docker in daemon mode
27
-  (sudo docker -d || echo "Docker daemon already running") &
28
-
29
-  # Start a very useful long-running process
30
-  JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done")
31
-
32
-  # Collect the output of the job so far
33
-  docker logs $JOB
34
-
35
-  # Kill the job
36
-  docker kill $JOB
37
-
38
-
39
-Listing all running containers
40
-
41
-.. code-block:: bash
42
-
43
-  docker ps
44
-
45
-Expose a service on a TCP port
46
-
47
-.. code-block:: bash
48
-
49
-  # Expose port 4444 of this container, and tell netcat to listen on it
50
-  JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444)
51
-
52
-  # Which public port is NATed to my container?
53
-  PORT=$(docker port $JOB 4444)
54
-
55
-  # Connect to the public port via the host's public address
56
-  echo hello world | nc $(hostname) $PORT
57
-
58
-  # Verify that the network connection worked
59
-  echo "Daemon received: $(docker logs $JOB)"
60
-
61
-Continue to the complete `Command Line Interface`_
62
-
63
-.. _Command Line Interface: ../commandline/cli.html
64 1
new file mode 100644
... ...
@@ -0,0 +1,100 @@
0
+:title: Base commands
1
+:description: Common usage and commands
2
+:keywords: Examples, Usage
3
+
4
+
5
+The basics
6
+=============
7
+
8
+Starting Docker
9
+---------------
10
+
11
+If you have used one of the quick install paths', Docker may have been installed with upstart, Ubuntu's
12
+system for starting processes at boot time. You should be able to run ``docker help`` and get output.
13
+
14
+If you get ``docker: command not found`` or something like ``/var/lib/docker/repositories: permission denied``
15
+you will need to specify the path to it and manually start it.
16
+
17
+.. code-block:: bash
18
+
19
+    # Run docker in daemon mode
20
+    sudo <path to>/docker -d &
21
+
22
+
23
+Running an interactive shell
24
+----------------------------
25
+
26
+.. code-block:: bash
27
+
28
+  # Download a base image
29
+  docker pull base
30
+
31
+  # Run an interactive shell in the base image,
32
+  # allocate a tty, attach stdin and stdout
33
+  docker run -i -t base /bin/bash
34
+
35
+
36
+Starting a long-running worker process
37
+--------------------------------------
38
+
39
+.. code-block:: bash
40
+
41
+  # Start a very useful long-running process
42
+  JOB=$(docker run -d base /bin/sh -c "while true; do echo Hello world; sleep 1; done")
43
+
44
+  # Collect the output of the job so far
45
+  docker logs $JOB
46
+
47
+  # Kill the job
48
+  docker kill $JOB
49
+
50
+
51
+Listing all running containers
52
+------------------------------
53
+
54
+.. code-block:: bash
55
+
56
+  docker ps
57
+
58
+Expose a service on a TCP port
59
+------------------------------
60
+
61
+.. code-block:: bash
62
+
63
+  # Expose port 4444 of this container, and tell netcat to listen on it
64
+  JOB=$(docker run -d -p 4444 base /bin/nc -l -p 4444)
65
+
66
+  # Which public port is NATed to my container?
67
+  PORT=$(docker port $JOB 4444)
68
+
69
+  # Connect to the public port via the host's public address
70
+  # Please note that because of how routing works connecting to localhost or 127.0.0.1 $PORT will not work.
71
+  echo hello world | nc $(hostname) $PORT
72
+
73
+  # Verify that the network connection worked
74
+  echo "Daemon received: $(docker logs $JOB)"
75
+
76
+
77
+Committing (saving) an image
78
+-----------------------------
79
+
80
+Save your containers state to a container image, so the state can be re-used.
81
+
82
+When you commit your container only the differences between the image the container was created from
83
+and the current state of the container will be stored (as a diff). See which images you already have
84
+using ``docker images``
85
+
86
+.. code-block:: bash
87
+
88
+    # Commit your container to a new named image
89
+    docker commit <container_id> <some_name>
90
+
91
+    # List your containers
92
+    docker images
93
+
94
+You now have a image state from which you can create new instances.
95
+
96
+
97
+
98
+Read more about :ref:`working_with_the_repository` or continue to the complete :ref:`cli`
99
+
... ...
@@ -2,6 +2,7 @@
2 2
 :description: Docker's CLI command description and usage
3 3
 :keywords: Docker, Docker documentation, CLI, command line
4 4
 
5
+.. _cli:
5 6
 
6 7
 Command Line Interface
7 8
 ======================
... ...
@@ -118,9 +119,9 @@ import
118 118
 
119 119
 ::
120 120
 
121
-Usage: docker import [OPTIONS] URL|- [REPOSITORY [TAG]]
121
+    Usage: docker import [OPTIONS] URL|- [REPOSITORY [TAG]]
122 122
 
123
-Create a new filesystem image from the contents of a tarball
123
+    Create a new filesystem image from the contents of a tarball
124 124
 
125 125
 
126 126
 info
... ...
@@ -258,7 +259,6 @@ run
258 258
 
259 259
   Run a command in a new container
260 260
 
261
-    -a=false: Attach stdin and stdout
262 261
     -c="": Comment
263 262
     -i=false: Keep stdin open even if not attached
264 263
     -m=0: Memory limit (in bytes)
... ...
@@ -11,5 +11,6 @@ Contents:
11 11
 .. toctree::
12 12
   :maxdepth: 2
13 13
 
14
-  basecommands
14
+  basics
15
+  workingwithrepository
15 16
   cli
16 17
\ No newline at end of file
17 18
new file mode 100644
... ...
@@ -0,0 +1,42 @@
0
+.. _working_with_the_repository:
1
+
2
+Working with the repository
3
+============================
4
+
5
+Connecting to the repository
6
+----------------------------
7
+
8
+You create a user on the central docker repository by running
9
+
10
+.. code-block:: bash
11
+
12
+    docker login
13
+
14
+
15
+If your username does not exist it will prompt you to also enter a password and your e-mail address. It will then
16
+automatically log you in.
17
+
18
+
19
+Committing a container to a named image
20
+---------------------------------------
21
+
22
+In order to commit to the repository it is required to have committed your container to an image with your namespace.
23
+
24
+.. code-block:: bash
25
+
26
+    # for example docker commit $CONTAINER_ID dhrp/kickassapp
27
+    docker commit <container_id> <your username>/<some_name>
28
+
29
+
30
+Pushing a container to the repository
31
+-----------------------------------------
32
+
33
+In order to push an image to the repository you need to have committed your container to a named image (see above)
34
+
35
+Now you can commit this image to the repository
36
+
37
+.. code-block:: bash
38
+
39
+    # for example docker push dhrp/kickassapp
40
+    docker push <image-name>
41
+
0 42
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+:title: Building blocks
1
+:description: An introduction to docker and standard containers?
2
+:keywords: containers, lxc, concepts, explanation
3
+
4
+
5
+Building blocks
6
+===============
7
+
8
+.. _images:
9
+
10
+Images
11
+------
12
+An original container image. These are stored on disk and are comparable with what you normally expect from a stoppped virtual machine image. Images are stored (and retrieved from) repository
13
+
14
+Images are stored on your local file system under /var/lib/docker/images
15
+
16
+
17
+.. _containers:
18
+
19
+Containers
20
+----------
21
+A container is a local version of an image. It can be running or stopped, The equivalent would be a virtual machine instance.
22
+
23
+Containers are stored on your local file system under /var/lib/docker/containers
24
+
... ...
@@ -1,11 +1,27 @@
1
-:title: Containers
2
-:description: What are standard containers?
1
+:title: Introduction
2
+:description: An introduction to docker and standard containers?
3 3
 :keywords: containers, lxc, concepts, explanation
4 4
 
5 5
 
6
+:note: This version of the introduction is temporary, just to make sure we don't break the links from the website when the documentation is updated
7
+
8
+
9
+Introduction
10
+============
11
+
12
+Docker - The Linux container runtime
13
+------------------------------------
14
+
15
+Docker complements LXC with a high-level API which operates at the process level. It runs unix processes with strong guarantees of isolation and repeatability across servers.
16
+
17
+Docker is a great building block for automating distributed systems: large-scale web deployments, database clusters, continuous deployment systems, private PaaS, service-oriented architectures, etc.
18
+
19
+
20
+- **Heterogeneous payloads** Any combination of binaries, libraries, configuration files, scripts, virtualenvs, jars, gems, tarballs, you name it. No more juggling between domain-specific tools. Docker can deploy and run them all.
21
+- **Any server** Docker can run on any x64 machine with a modern linux kernel - whether it's a laptop, a bare metal server or a VM. This makes it perfect for multi-cloud deployments.
22
+- **Isolation** docker isolates processes from each other and from the underlying host, using lightweight containers.
23
+- **Repeatability** Because containers are isolated in their own filesystem, they behave the same regardless of where, when, and alongside what they run.
6 24
 
7
-Standard Containers
8
-===================
9 25
 
10 26
 
11 27
 What is a Standard Container?
... ...
@@ -19,25 +35,25 @@ The spec for Standard Containers is currently work in progress, but it is very s
19 19
 A great analogy for this is the shipping container. Just like Standard Containers are a fundamental unit of software delivery, shipping containers (http://bricks.argz.com/ins/7823-1/12) are a fundamental unit of physical delivery.
20 20
 
21 21
 Standard operations
22
+~~~~~~~~~~~~~~~~~~~
22 23
 
23 24
 Just like shipping containers, Standard Containers define a set of STANDARD OPERATIONS. Shipping containers can be lifted, stacked, locked, loaded, unloaded and labelled. Similarly, standard containers can be started, stopped, copied, snapshotted, downloaded, uploaded and tagged.
24 25
 
25 26
 
26 27
 Content-agnostic
28
+~~~~~~~~~~~~~~~~~~~
27 29
 
28 30
 Just like shipping containers, Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. A shipping container will be stacked in exactly the same way whether it contains Vietnamese powder coffee or spare Maserati parts. Similarly, Standard Containers are started or uploaded in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts.
29 31
 
30 32
 
31 33
 Infrastructure-agnostic
34
+~~~~~~~~~~~~~~~~~~~~~~~~~~
32 35
 
33 36
 Both types of containers are INFRASTRUCTURE-AGNOSTIC: they can be transported to thousands of facilities around the world, and manipulated by a wide variety of equipment. A shipping container can be packed in a factory in Ukraine, transported by truck to the nearest routing center, stacked onto a train, loaded into a German boat by an Australian-built crane, stored in a warehouse at a US facility, etc. Similarly, a standard container can be bundled on my laptop, uploaded to S3, downloaded, run and snapshotted by a build server at Equinix in Virginia, uploaded to 10 staging servers in a home-made Openstack cluster, then sent to 30 production instances across 3 EC2 regions.
34 37
 
35 38
 
36 39
 Designed for automation
40
+~~~~~~~~~~~~~~~~~~~~~~~~~~
37 41
 
38 42
 Because they offer the same standard operations regardless of content and infrastructure, Standard Containers, just like their physical counterpart, are extremely well-suited for automation. In fact, you could say automation is their secret weapon.
39 43
 
... ...
@@ -47,7 +63,7 @@ Similarly, before Standard Containers, by the time a software component ran in p
47 47
 
48 48
 
49 49
 Industrial-grade delivery
50
+~~~~~~~~~~~~~~~~~~~~~~~~~~
50 51
 
51 52
 There are 17 million shipping containers in existence, packed with every physical good imaginable. Every single one of them can be loaded on the same boats, by the same cranes, in the same facilities, and sent anywhere in the World with incredible efficiency. It is embarrassing to think that a 30 ton shipment of coffee can safely travel half-way across the World in *less time* than it takes a software team to deliver its code from one datacenter to another sitting 10 miles away.
52 53
 
... ...
@@ -55,7 +71,7 @@ With Standard Containers we can put an end to that embarrassment, by making INDU
55 55
 
56 56
 
57 57
 Standard Container Specification
58
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 59
 
59 60
 (TODO)
60 61
 
... ...
@@ -12,5 +12,6 @@ Contents:
12 12
 .. toctree::
13 13
    :maxdepth: 1
14 14
 
15
-   containers
15
+   introduction
16
+   buildingblocks
16 17
 
17 18
new file mode 100644
... ...
@@ -0,0 +1,127 @@
0
+:title: Introduction
1
+:description: An introduction to docker and standard containers?
2
+:keywords: containers, lxc, concepts, explanation
3
+
4
+
5
+
6
+Introduction
7
+============
8
+
9
+Docker - The Linux container runtime
10
+------------------------------------
11
+
12
+Docker complements LXC with a high-level API which operates at the process level. It runs unix processes with strong guarantees of isolation and repeatability across servers.
13
+
14
+Docker is a great building block for automating distributed systems: large-scale web deployments, database clusters, continuous deployment systems, private PaaS, service-oriented architectures, etc.
15
+
16
+
17
+- **Heterogeneous payloads** Any combination of binaries, libraries, configuration files, scripts, virtualenvs, jars, gems, tarballs, you name it. No more juggling between domain-specific tools. Docker can deploy and run them all.
18
+- **Any server** Docker can run on any x64 machine with a modern linux kernel - whether it's a laptop, a bare metal server or a VM. This makes it perfect for multi-cloud deployments.
19
+- **Isolation** docker isolates processes from each other and from the underlying host, using lightweight containers.
20
+- **Repeatability** Because containers are isolated in their own filesystem, they behave the same regardless of where, when, and alongside what they run.
21
+
22
+.. image:: http://www.docker.io/_static/lego_docker.jpg
23
+
24
+
25
+What is a Standard Container?
26
+-----------------------------
27
+
28
+Docker defines a unit of software delivery called a Standard Container. The goal of a Standard Container is to encapsulate a software component and all its dependencies in
29
+a format that is self-describing and portable, so that any compliant runtime can run it without extra dependency, regardless of the underlying machine and the contents of the container.
30
+
31
+The spec for Standard Containers is currently work in progress, but it is very straightforward. It mostly defines 1) an image format, 2) a set of standard operations, and 3) an execution environment.
32
+
33
+A great analogy for this is the shipping container. Just like Standard Containers are a fundamental unit of software delivery, shipping containers (http://bricks.argz.com/ins/7823-1/12) are a fundamental unit of physical delivery.
34
+
35
+Standard operations
36
+~~~~~~~~~~~~~~~~~~~
37
+
38
+Just like shipping containers, Standard Containers define a set of STANDARD OPERATIONS. Shipping containers can be lifted, stacked, locked, loaded, unloaded and labelled. Similarly, standard containers can be started, stopped, copied, snapshotted, downloaded, uploaded and tagged.
39
+
40
+
41
+Content-agnostic
42
+~~~~~~~~~~~~~~~~~~~
43
+
44
+Just like shipping containers, Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. A shipping container will be stacked in exactly the same way whether it contains Vietnamese powder coffee or spare Maserati parts. Similarly, Standard Containers are started or uploaded in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts.
45
+
46
+
47
+Infrastructure-agnostic
48
+~~~~~~~~~~~~~~~~~~~~~~~~~~
49
+
50
+Both types of containers are INFRASTRUCTURE-AGNOSTIC: they can be transported to thousands of facilities around the world, and manipulated by a wide variety of equipment. A shipping container can be packed in a factory in Ukraine, transported by truck to the nearest routing center, stacked onto a train, loaded into a German boat by an Australian-built crane, stored in a warehouse at a US facility, etc. Similarly, a standard container can be bundled on my laptop, uploaded to S3, downloaded, run and snapshotted by a build server at Equinix in Virginia, uploaded to 10 staging servers in a home-made Openstack cluster, then sent to 30 production instances across 3 EC2 regions.
51
+
52
+
53
+Designed for automation
54
+~~~~~~~~~~~~~~~~~~~~~~~~~~
55
+
56
+Because they offer the same standard operations regardless of content and infrastructure, Standard Containers, just like their physical counterpart, are extremely well-suited for automation. In fact, you could say automation is their secret weapon.
57
+
58
+Many things that once required time-consuming and error-prone human effort can now be programmed. Before shipping containers, a bag of powder coffee was hauled, dragged, dropped, rolled and stacked by 10 different people in 10 different locations by the time it reached its destination. 1 out of 50 disappeared. 1 out of 20 was damaged. The process was slow, inefficient and cost a fortune - and was entirely different depending on the facility and the type of goods.
59
+
60
+Similarly, before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider.
61
+
62
+
63
+Industrial-grade delivery
64
+~~~~~~~~~~~~~~~~~~~~~~~~~~
65
+
66
+There are 17 million shipping containers in existence, packed with every physical good imaginable. Every single one of them can be loaded on the same boats, by the same cranes, in the same facilities, and sent anywhere in the World with incredible efficiency. It is embarrassing to think that a 30 ton shipment of coffee can safely travel half-way across the World in *less time* than it takes a software team to deliver its code from one datacenter to another sitting 10 miles away.
67
+
68
+With Standard Containers we can put an end to that embarrassment, by making INDUSTRIAL-GRADE DELIVERY of software a reality.
69
+
70
+
71
+Standard Container Specification
72
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73
+
74
+(TODO)
75
+
76
+Image format
77
+~~~~~~~~~~~~
78
+
79
+Standard operations
80
+~~~~~~~~~~~~~~~~~~~
81
+
82
+-  Copy
83
+-  Run
84
+-  Stop
85
+-  Wait
86
+-  Commit
87
+-  Attach standard streams
88
+-  List filesystem changes
89
+-  ...
90
+
91
+Execution environment
92
+~~~~~~~~~~~~~~~~~~~~~
93
+
94
+Root filesystem
95
+^^^^^^^^^^^^^^^
96
+
97
+Environment variables
98
+^^^^^^^^^^^^^^^^^^^^^
99
+
100
+Process arguments
101
+^^^^^^^^^^^^^^^^^
102
+
103
+Networking
104
+^^^^^^^^^^
105
+
106
+Process namespacing
107
+^^^^^^^^^^^^^^^^^^^
108
+
109
+Resource limits
110
+^^^^^^^^^^^^^^^
111
+
112
+Process monitoring
113
+^^^^^^^^^^^^^^^^^^
114
+
115
+Logging
116
+^^^^^^^
117
+
118
+Signals
119
+^^^^^^^
120
+
121
+Pseudo-terminal allocation
122
+^^^^^^^^^^^^^^^^^^^^^^^^^^
123
+
124
+Security
125
+^^^^^^^^
126
+
... ...
@@ -22,10 +22,12 @@ Instructions that have been verified to work on Ubuntu 12.10,
22 22
     go get -v github.com/dotcloud/docker/...
23 23
     go install -v github.com/dotcloud/docker/...
24 24
 
25
+
25 26
 Then run the docker daemon,
26 27
 
27 28
 .. code-block:: bash
28 29
 
29 30
     sudo $GOPATH/bin/docker -d
30 31
 
32
+
31 33
 Run the ``go install`` command (above) to recompile docker.
... ...
@@ -6,9 +6,7 @@
6 6
 
7 7
 Hello World
8 8
 ===========
9
-This is the most basic example available for using docker
10
-
11
-This example assumes you have Docker installed.
9
+This is the most basic example available for using Docker. The example assumes you have Docker installed.
12 10
 
13 11
 
14 12
 Download the base container
... ...
@@ -79,11 +79,3 @@ See the example in action
79 79
     </div>
80 80
 
81 81
 Continue to the :ref:`python_web_app` example.
82
-
83
-
84
-Notes:
85
-
86
-- **Docker daemon** The docker daemon is started by ``sudo docker -d``, Vagrant may have started
87
-  the Docker daemon for you, but you will need to restart it this way if it was terminated. Otherwise
88
-  it may give you ``Couldn't create Tag store: open /var/lib/docker/repositories: permission denied``
... ...
@@ -15,3 +15,4 @@ Contents:
15 15
    hello_world
16 16
    hello_world_daemon
17 17
    python_web_app
18
+   runningsshservice
18 19
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+
1
+Create an ssh daemon service
2
+============================
3
+
4
+
5
+
6
+
7
+**Video:**
8
+
9
+I've create a little screencast to show how to create a sshd service and connect to it. It is something like 11
10
+minutes and not entirely smooth, but gives you a good idea.
11
+
12
+.. raw:: html
13
+
14
+    <div style="margin-top:10px;">
15
+      <iframe width="800" height="400" src="http://ascii.io/a/2637/raw" frameborder="0"></iframe>
16
+    </div>
17
+
18
+
19
+You can also get this sshd container by using
20
+::
21
+
22
+    docker pull dhrp/sshd
23
+
24
+
25
+The password is 'screencast'
26
+
... ...
@@ -5,43 +5,43 @@ FAQ
5 5
 Most frequently asked questions.
6 6
 --------------------------------
7 7
 
8
-**1. How much does Docker cost?**
8
+1. **How much does Docker cost?**
9 9
 
10
-Docker is 100% free, it is open source, so you can use it without paying.
10
+   Docker is 100% free, it is open source, so you can use it without paying.
11 11
 
12
-**2. What open source license are you using?**
12
+2. **What open source license are you using?**
13 13
 
14
-We are using the Apache License Version 2.0, see it here: https://github.com/dotcloud/docker/blob/master/LICENSE
14
+   We are using the Apache License Version 2.0, see it here: https://github.com/dotcloud/docker/blob/master/LICENSE
15 15
 
16
-**3. Does Docker run on Mac OS X or Windows?**
16
+3. **Does Docker run on Mac OS X or Windows?**
17 17
 
18
-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.
18
+   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.
19 19
 
20
-**4. How do containers compare to virtual machines?**
20
+4. **How do containers compare to virtual machines?**
21 21
 
22
-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.
22
+   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.
23 23
 
24
-**5. Can I help by adding some questions and answers?**
24
+5. **Can I help by adding some questions and answers?**
25 25
 
26
-Definitely! You can fork `the repo`_ and edit the documentation sources.
26
+   Definitely! You can fork `the repo`_ and edit the documentation sources.
27 27
 
28 28
 
29
-**42. Where can I find more answers?**
29
+42. **Where can I find more answers?**
30 30
 
31
-You can find more answers on:
31
+    You can find more answers on:
32 32
 
33
-* `IRC: docker on freenode`_
34
-* `Github`_
35
-* `Ask questions on Stackoverflow`_
36
-* `Join the conversation on Twitter`_
33
+    * `IRC: docker on freenode`_
34
+    * `Github`_
35
+    * `Ask questions on Stackoverflow`_
36
+    * `Join the conversation on Twitter`_
37 37
 
38
-.. _Windows: ../documentation/installation/windows.html
39
-.. _MacOSX: ../documentation/installation/macos.html
40
-.. _the repo: http://www.github.com/dotcloud/docker
41
-.. _IRC\: docker on freenode: irc://chat.freenode.net#docker
42
-.. _Github: http://www.github.com/dotcloud/docker
43
-.. _Ask questions on Stackoverflow: http://stackoverflow.com/search?q=docker
44
-.. _Join the conversation on Twitter: http://twitter.com/getdocker
38
+    .. _Windows: ../documentation/installation/windows.html
39
+    .. _MacOSX: ../documentation/installation/macos.html
40
+    .. _the repo: http://www.github.com/dotcloud/docker
41
+    .. _IRC\: docker on freenode: irc://chat.freenode.net#docker
42
+    .. _Github: http://www.github.com/dotcloud/docker
43
+    .. _Ask questions on Stackoverflow: http://stackoverflow.com/search?q=docker
44
+    .. _Join the conversation on Twitter: http://twitter.com/getdocker
45 45
 
46 46
 
47 47
 Looking for something else to read? Checkout the :ref:`hello_world` example.
... ...
@@ -16,3 +16,4 @@ Contents:
16 16
    macos
17 17
    windows
18 18
    amazon
19
+   upgrading
... ...
@@ -42,7 +42,15 @@ Run your first container!
42 42
 
43 43
     sudo ./docker run -i -t base /bin/bash
44 44
 
45
-Consider adding docker to your PATH for simplicity.
46 45
 
46
+To run docker as a daemon, in the background, and allow non-root users to run ``docker`` start
47
+docker -d
48
+
49
+::
50
+
51
+    sudo ./docker -d &
52
+
53
+
54
+Consider adding docker to your PATH for simplicity.
47 55
 
48 56
 Continue with the :ref:`hello_world` example.
49 57
\ No newline at end of file
50 58
new file mode 100644
... ...
@@ -0,0 +1,40 @@
0
+.. _upgrading:
1
+
2
+Upgrading
3
+============
4
+
5
+   We assume you are upgrading from within the operating system which runs your docker daemon.
6
+
7
+
8
+Get the latest docker binary:
9
+
10
+::
11
+
12
+  wget http://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-master.tgz
13
+
14
+
15
+
16
+Unpack it to your current dir
17
+
18
+::
19
+
20
+   tar -xf docker-master.tgz
21
+
22
+
23
+Stop your current daemon. How you stop your daemon depends on how you started it.
24
+
25
+- If you started the daemon manually (``sudo docker -d``), you can just kill the process: ``killall docker``
26
+- If the process was started using upstart (the ubuntu startup daemon), you may need to use that to stop it
27
+
28
+
29
+Start docker in daemon mode (-d) and disconnect (&) starting ./docker will start the version in your current dir rather
30
+than the one in your PATH.
31
+
32
+Now start the daemon
33
+
34
+::
35
+
36
+   sudo ./docker -d &
37
+
38
+
39
+Alternatively you can replace the docker binary in ``/usr/local/bin``
0 40
\ No newline at end of file