| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 |
-:title: Ambassador pattern linking |
|
| 1 |
+:title: Link via an Ambassador Container |
|
| 2 | 2 |
:description: Using the Ambassador pattern to abstract (network) services |
| 3 | 3 |
:keywords: Examples, Usage, links, docker, documentation, examples, names, name, container naming |
| 4 | 4 |
|
| 5 | 5 |
.. _ambassador_pattern_linking: |
| 6 | 6 |
|
| 7 |
-Ambassador pattern linking |
|
| 8 |
-========================== |
|
| 7 |
+Link via an Ambassador Container |
|
| 8 |
+================================ |
|
| 9 | 9 |
|
| 10 | 10 |
Rather than hardcoding network links between a service consumer and provider, Docker |
| 11 | 11 |
encourages service portability. |
| ... | ... |
@@ -1,10 +1,10 @@ |
| 1 |
-:title: Base Image Creation |
|
| 1 |
+:title: Create a Base Image |
|
| 2 | 2 |
:description: How to create base images |
| 3 | 3 |
:keywords: Examples, Usage, base image, docker, documentation, examples |
| 4 | 4 |
|
| 5 | 5 |
.. _base_image_creation: |
| 6 | 6 |
|
| 7 |
-Base Image Creation |
|
| 7 |
+Create a Base Image |
|
| 8 | 8 |
=================== |
| 9 | 9 |
|
| 10 | 10 |
So you want to create your own :ref:`base_image_def`? Great! |
| ... | ... |
@@ -1,10 +1,10 @@ |
| 1 |
-:title: Basic Commands |
|
| 1 |
+:title: Learn Basic Commands |
|
| 2 | 2 |
:description: Common usage and commands |
| 3 | 3 |
:keywords: Examples, Usage, basic commands, docker, documentation, examples |
| 4 | 4 |
|
| 5 | 5 |
|
| 6 |
-The Basics |
|
| 7 |
-========== |
|
| 6 |
+Learn Basic Commands |
|
| 7 |
+==================== |
|
| 8 | 8 |
|
| 9 | 9 |
Starting Docker |
| 10 | 10 |
--------------- |
| ... | ... |
@@ -1,12 +1,12 @@ |
| 1 |
-:title: Dockerfiles for Images |
|
| 1 |
+:title: Build Images (Dockerfile Reference) |
|
| 2 | 2 |
:description: Dockerfiles use a simple DSL which allows you to automate the steps you would normally manually take to create an image. |
| 3 | 3 |
:keywords: builder, docker, Dockerfile, automation, image creation |
| 4 | 4 |
|
| 5 | 5 |
.. _dockerbuilder: |
| 6 | 6 |
|
| 7 |
-====================== |
|
| 8 |
-Dockerfiles for Images |
|
| 9 |
-====================== |
|
| 7 |
+=================================== |
|
| 8 |
+Build Images (Dockerfile Reference) |
|
| 9 |
+=================================== |
|
| 10 | 10 |
|
| 11 | 11 |
**Docker can act as a builder** and read instructions from a text |
| 12 | 12 |
``Dockerfile`` to automate the steps you would otherwise take manually |
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 |
-:title: Host Integration |
|
| 1 |
+:title: Automatically Start Containers |
|
| 2 | 2 |
:description: How to generate scripts for upstart, systemd, etc. |
| 3 | 3 |
:keywords: systemd, upstart, supervisor, docker, documentation, host integration |
| 4 | 4 |
|
| 5 | 5 |
|
| 6 | 6 |
|
| 7 |
-Host Integration |
|
| 8 |
-================ |
|
| 7 |
+Automatically Start Containers |
|
| 8 |
+============================== |
|
| 9 | 9 |
|
| 10 | 10 |
You can use your Docker containers with process managers like ``upstart``, |
| 11 | 11 |
``systemd`` and ``supervisor``. |
| ... | ... |
@@ -1,14 +1,14 @@ |
| 1 |
-:title: Docker networking |
|
| 1 |
+:title: Configure Networking |
|
| 2 | 2 |
:description: Docker networking |
| 3 | 3 |
:keywords: network, networking, bridge, docker, documentation |
| 4 | 4 |
|
| 5 | 5 |
|
| 6 |
-Networking |
|
| 7 |
-========== |
|
| 6 |
+Configure Networking |
|
| 7 |
+==================== |
|
| 8 | 8 |
|
| 9 |
-Docker uses Linux bridge capabilities to provide network connectivity |
|
| 10 |
-to containers. The ``docker0`` bridge interface is managed by Docker itself |
|
| 11 |
-for this purpose. Thus, when the Docker daemon starts it : |
|
| 9 |
+Docker uses Linux bridge capabilities to provide network connectivity |
|
| 10 |
+to containers. The ``docker0`` bridge interface is managed by Docker |
|
| 11 |
+itself for this purpose. Thus, when the Docker daemon starts it : |
|
| 12 | 12 |
|
| 13 | 13 |
- creates the ``docker0`` bridge if not present |
| 14 | 14 |
- searches for an IP address range which doesn't overlap with an existing route |
| ... | ... |
@@ -30,11 +30,12 @@ for this purpose. Thus, when the Docker daemon starts it : |
| 30 | 30 |
|
| 31 | 31 |
|
| 32 | 32 |
|
| 33 |
-At runtime, a :ref:`specific kind of virtual interface<vethxxxx-device>` is |
|
| 34 |
-given to each containers which is then bonded to the ``docker0`` bridge. |
|
| 35 |
-Each containers also receives a dedicated IP address from the same range |
|
| 36 |
-as ``docker0``. The ``docker0`` IP address is then used as the default |
|
| 37 |
-gateway for the containers. |
|
| 33 |
+At runtime, a :ref:`specific kind of virtual |
|
| 34 |
+interface<vethxxxx-device>` is given to each containers which is then |
|
| 35 |
+bonded to the ``docker0`` bridge. Each containers also receives a |
|
| 36 |
+dedicated IP address from the same range as ``docker0``. The |
|
| 37 |
+``docker0`` IP address is then used as the default gateway for the |
|
| 38 |
+containers. |
|
| 38 | 39 |
|
| 39 | 40 |
.. code-block:: bash |
| 40 | 41 |
|
| ... | ... |
@@ -47,18 +48,19 @@ gateway for the containers. |
| 47 | 47 |
docker0 8000.fef213db5a66 no vethQCDY1N |
| 48 | 48 |
|
| 49 | 49 |
|
| 50 |
-Above, ``docker0`` acts as a bridge for the ``vethQCDY1N`` interface which is dedicated |
|
| 51 |
-to the 52f811c5d3d6 container. |
|
| 50 |
+Above, ``docker0`` acts as a bridge for the ``vethQCDY1N`` interface |
|
| 51 |
+which is dedicated to the 52f811c5d3d6 container. |
|
| 52 | 52 |
|
| 53 | 53 |
|
| 54 | 54 |
How to use a specific IP address range |
| 55 | 55 |
--------------------------------------- |
| 56 |
-Docker will try hard to find an IP range which is not used by the host. |
|
| 57 |
-Even if it works for most cases, it's not bullet-proof and sometimes you need |
|
| 58 |
-to have more control over the IP addressing scheme. |
|
| 59 | 56 |
|
| 60 |
-For this purpose, Docker allows you to manage the ``docker0`` bridge or |
|
| 61 |
-your own one using the ``-b=<bridgename>`` parameter. |
|
| 57 |
+Docker will try hard to find an IP range which is not used by the |
|
| 58 |
+host. Even if it works for most cases, it's not bullet-proof and |
|
| 59 |
+sometimes you need to have more control over the IP addressing scheme. |
|
| 60 |
+ |
|
| 61 |
+For this purpose, Docker allows you to manage the ``docker0`` bridge |
|
| 62 |
+or your own one using the ``-b=<bridgename>`` parameter. |
|
| 62 | 63 |
|
| 63 | 64 |
In this scenario: |
| 64 | 65 |
|
| ... | ... |
@@ -115,14 +117,15 @@ In this scenario: |
| 115 | 115 |
|
| 116 | 116 |
Container intercommunication |
| 117 | 117 |
------------------------------- |
| 118 |
-Containers can communicate with each other according to the ``icc`` parameter |
|
| 119 |
-value of the Docker daemon. |
|
| 118 |
+ |
|
| 119 |
+Containers can communicate with each other according to the ``icc`` |
|
| 120 |
+parameter value of the Docker daemon. |
|
| 120 | 121 |
|
| 121 | 122 |
- The default, ``-icc=true`` allows containers to communicate with each other. |
| 122 | 123 |
- ``-icc=false`` means containers are isolated from each other. |
| 123 | 124 |
|
| 124 |
-Under the hood, ``iptables`` is used by Docker to either accept or drop communication |
|
| 125 |
-between containers. |
|
| 125 |
+Under the hood, ``iptables`` is used by Docker to either accept or |
|
| 126 |
+drop communication between containers. |
|
| 126 | 127 |
|
| 127 | 128 |
|
| 128 | 129 |
.. _vethxxxx-device: |
| ... | ... |
@@ -131,17 +134,20 @@ What's about the vethXXXX device? |
| 131 | 131 |
----------------------------------- |
| 132 | 132 |
Well. Things get complicated here. |
| 133 | 133 |
|
| 134 |
-The ``vethXXXX`` interface is the host side of a point-to-point link between the |
|
| 135 |
-host and the corresponding container, the other side of the link being |
|
| 136 |
-materialized by the container's ``eth0`` interface. This pair (host ``vethXXX`` and |
|
| 137 |
-container ``eth0``) are connected like a tube. Everything that comes in one side will |
|
| 138 |
-come out the other side. |
|
| 134 |
+The ``vethXXXX`` interface is the host side of a point-to-point link |
|
| 135 |
+between the host and the corresponding container, the other side of |
|
| 136 |
+the link being materialized by the container's ``eth0`` |
|
| 137 |
+interface. This pair (host ``vethXXX`` and container ``eth0``) are |
|
| 138 |
+connected like a tube. Everything that comes in one side will come out |
|
| 139 |
+the other side. |
|
| 139 | 140 |
|
| 140 |
-All the plumbing is delegated to Linux network capabilities (check the ip link |
|
| 141 |
-command) and the namespaces infrastructure. |
|
| 141 |
+All the plumbing is delegated to Linux network capabilities (check the |
|
| 142 |
+ip link command) and the namespaces infrastructure. |
|
| 142 | 143 |
|
| 143 | 144 |
|
| 144 | 145 |
I want more |
| 145 | 146 |
------------ |
| 146 |
-Jérôme Petazzoni has create ``pipework`` to connect together containers in |
|
| 147 |
-arbitrarily complex scenarios : https://github.com/jpetazzo/pipework |
|
| 147 |
+ |
|
| 148 |
+Jérôme Petazzoni has create ``pipework`` to connect together |
|
| 149 |
+containers in arbitrarily complex scenarios : |
|
| 150 |
+https://github.com/jpetazzo/pipework |
| ... | ... |
@@ -1,12 +1,12 @@ |
| 1 |
-:title: Port redirection |
|
| 1 |
+:title: Redirect Ports |
|
| 2 | 2 |
:description: usage about port redirection |
| 3 | 3 |
:keywords: Usage, basic port, docker, documentation, examples |
| 4 | 4 |
|
| 5 | 5 |
|
| 6 | 6 |
.. _port_redirection: |
| 7 | 7 |
|
| 8 |
-Port redirection |
|
| 9 |
-================ |
|
| 8 |
+Redirect Ports |
|
| 9 |
+============== |
|
| 10 | 10 |
|
| 11 | 11 |
Interacting with a service is commonly done through a connection to a |
| 12 | 12 |
port. When this service runs inside a container, one can connect to |
| ... | ... |
@@ -1,15 +1,16 @@ |
| 1 |
-:title: Working with Links and Names |
|
| 2 |
-:description: How to create and use links and names |
|
| 1 |
+:title: Link Containers |
|
| 2 |
+:description: How to create and use both links and names |
|
| 3 | 3 |
:keywords: Examples, Usage, links, linking, docker, documentation, examples, names, name, container naming |
| 4 | 4 |
|
| 5 | 5 |
.. _working_with_links_names: |
| 6 | 6 |
|
| 7 |
-Working with Links and Names |
|
| 8 |
-============================ |
|
| 7 |
+Link Containers |
|
| 8 |
+=============== |
|
| 9 | 9 |
|
| 10 |
-From version 0.6.5 you are now able to ``name`` a container and ``link`` it to another |
|
| 11 |
-container by referring to its name. This will create a parent -> child relationship |
|
| 12 |
-where the parent container can see selected information about its child. |
|
| 10 |
+From version 0.6.5 you are now able to ``name`` a container and |
|
| 11 |
+``link`` it to another container by referring to its name. This will |
|
| 12 |
+create a parent -> child relationship where the parent container can |
|
| 13 |
+see selected information about its child. |
|
| 13 | 14 |
|
| 14 | 15 |
.. _run_name: |
| 15 | 16 |
|
| ... | ... |
@@ -18,8 +19,9 @@ Container Naming |
| 18 | 18 |
|
| 19 | 19 |
.. versionadded:: v0.6.5 |
| 20 | 20 |
|
| 21 |
-You can now name your container by using the ``-name`` flag. If no name is provided, Docker |
|
| 22 |
-will automatically generate a name. You can see this name using the ``docker ps`` command. |
|
| 21 |
+You can now name your container by using the ``-name`` flag. If no |
|
| 22 |
+name is provided, Docker will automatically generate a name. You can |
|
| 23 |
+see this name using the ``docker ps`` command. |
|
| 23 | 24 |
|
| 24 | 25 |
.. code-block:: bash |
| 25 | 26 |
|
| ... | ... |
@@ -38,18 +40,21 @@ Links: service discovery for docker |
| 38 | 38 |
|
| 39 | 39 |
.. versionadded:: v0.6.5 |
| 40 | 40 |
|
| 41 |
-Links allow containers to discover and securely communicate with each other by using the |
|
| 42 |
-flag ``-link name:alias``. Inter-container communication can be disabled with the daemon |
|
| 43 |
-flag ``-icc=false``. With this flag set to ``false``, Container A cannot access Container B |
|
| 44 |
-unless explicitly allowed via a link. This is a huge win for securing your containers. |
|
| 45 |
-When two containers are linked together Docker creates a parent child relationship |
|
| 46 |
-between the containers. The parent container will be able to access information via |
|
| 47 |
-environment variables of the child such as name, exposed ports, IP and other selected |
|
| 48 |
-environment variables. |
|
| 49 |
- |
|
| 50 |
-When linking two containers Docker will use the exposed ports of the container to create |
|
| 51 |
-a secure tunnel for the parent to access. If a database container only exposes port 8080 |
|
| 52 |
-then the linked container will only be allowed to access port 8080 and nothing else if |
|
| 41 |
+Links allow containers to discover and securely communicate with each |
|
| 42 |
+other by using the flag ``-link name:alias``. Inter-container |
|
| 43 |
+communication can be disabled with the daemon flag |
|
| 44 |
+``-icc=false``. With this flag set to ``false``, Container A cannot |
|
| 45 |
+access Container B unless explicitly allowed via a link. This is a |
|
| 46 |
+huge win for securing your containers. When two containers are linked |
|
| 47 |
+together Docker creates a parent child relationship between the |
|
| 48 |
+containers. The parent container will be able to access information |
|
| 49 |
+via environment variables of the child such as name, exposed ports, IP |
|
| 50 |
+and other selected environment variables. |
|
| 51 |
+ |
|
| 52 |
+When linking two containers Docker will use the exposed ports of the |
|
| 53 |
+container to create a secure tunnel for the parent to access. If a |
|
| 54 |
+database container only exposes port 8080 then the linked container |
|
| 55 |
+will only be allowed to access port 8080 and nothing else if |
|
| 53 | 56 |
inter-container communication is set to false. |
| 54 | 57 |
|
| 55 | 58 |
For example, there is an image called ``crosbymichael/redis`` that exposes the |
| ... | ... |
@@ -60,26 +65,28 @@ based on that image and run it as daemon. |
| 60 | 60 |
|
| 61 | 61 |
$ sudo docker run -d -name redis crosbymichael/redis |
| 62 | 62 |
|
| 63 |
-We can issue all the commands that you would expect using the name ``redis``; start, stop, |
|
| 64 |
-attach, using the name for our container. The name also allows us to link other containers |
|
| 65 |
-into this one. |
|
| 63 |
+We can issue all the commands that you would expect using the name |
|
| 64 |
+``redis``; start, stop, attach, using the name for our container. The |
|
| 65 |
+name also allows us to link other containers into this one. |
|
| 66 | 66 |
|
| 67 |
-Next, we can start a new web application that has a dependency on Redis and apply a link |
|
| 68 |
-to connect both containers. If you noticed when running our Redis server we did not use |
|
| 69 |
-the ``-p`` flag to publish the Redis port to the host system. Redis exposed port 6379 and |
|
| 70 |
-this is all we need to establish a link. |
|
| 67 |
+Next, we can start a new web application that has a dependency on |
|
| 68 |
+Redis and apply a link to connect both containers. If you noticed when |
|
| 69 |
+running our Redis server we did not use the ``-p`` flag to publish the |
|
| 70 |
+Redis port to the host system. Redis exposed port 6379 and this is all |
|
| 71 |
+we need to establish a link. |
|
| 71 | 72 |
|
| 72 | 73 |
.. code-block:: bash |
| 73 | 74 |
|
| 74 | 75 |
$ sudo docker run -t -i -link redis:db -name webapp ubuntu bash |
| 75 | 76 |
|
| 76 |
-When you specified ``-link redis:db`` you are telling Docker to link the container named ``redis`` |
|
| 77 |
-into this new container with the alias ``db``. Environment variables are prefixed with the alias |
|
| 78 |
-so that the parent container can access network and environment information from the containers |
|
| 79 |
-that are linked into it. |
|
| 77 |
+When you specified ``-link redis:db`` you are telling Docker to link |
|
| 78 |
+the container named ``redis`` into this new container with the alias |
|
| 79 |
+``db``. Environment variables are prefixed with the alias so that the |
|
| 80 |
+parent container can access network and environment information from |
|
| 81 |
+the containers that are linked into it. |
|
| 80 | 82 |
|
| 81 |
-If we inspect the environment variables of the second container, we would see all the information |
|
| 82 |
-about the child container. |
|
| 83 |
+If we inspect the environment variables of the second container, we |
|
| 84 |
+would see all the information about the child container. |
|
| 83 | 85 |
|
| 84 | 86 |
.. code-block:: bash |
| 85 | 87 |
|
| ... | ... |
@@ -101,10 +108,12 @@ about the child container. |
| 101 | 101 |
_=/usr/bin/env |
| 102 | 102 |
root@4c01db0b339c:/# |
| 103 | 103 |
|
| 104 |
-Accessing the network information along with the environment of the child container allows |
|
| 105 |
-us to easily connect to the Redis service on the specific IP and port in the environment. |
|
| 104 |
+Accessing the network information along with the environment of the |
|
| 105 |
+child container allows us to easily connect to the Redis service on |
|
| 106 |
+the specific IP and port in the environment. |
|
| 106 | 107 |
|
| 107 |
-Running ``docker ps`` shows the 2 containers, and the ``webapp/db`` alias name for the redis container. |
|
| 108 |
+Running ``docker ps`` shows the 2 containers, and the ``webapp/db`` |
|
| 109 |
+alias name for the redis container. |
|
| 108 | 110 |
|
| 109 | 111 |
.. code-block:: bash |
| 110 | 112 |
|
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 |
-:title: Working with Volumes |
|
| 1 |
+:title: Share Directories via Volumes |
|
| 2 | 2 |
:description: How to create and share volumes |
| 3 | 3 |
:keywords: Examples, Usage, volume, docker, documentation, examples |
| 4 | 4 |
|
| 5 | 5 |
.. _volume_def: |
| 6 | 6 |
|
| 7 |
-Data Volume |
|
| 8 |
-=========== |
|
| 7 |
+Share Directories via Volumes |
|
| 8 |
+============================= |
|
| 9 | 9 |
|
| 10 | 10 |
.. versionadded:: v0.3.0 |
| 11 | 11 |
Data volumes have been available since version 1 of the |
| ... | ... |
@@ -1,11 +1,11 @@ |
| 1 |
-:title: Working With Repositories |
|
| 1 |
+:title: Share Images via Repositories |
|
| 2 | 2 |
:description: Repositories allow users to share images. |
| 3 | 3 |
:keywords: repo, repositories, usage, pull image, push image, image, documentation |
| 4 | 4 |
|
| 5 | 5 |
.. _working_with_the_repository: |
| 6 | 6 |
|
| 7 |
-Working with Repositories |
|
| 8 |
-========================= |
|
| 7 |
+Share Images via Repositories |
|
| 8 |
+============================= |
|
| 9 | 9 |
|
| 10 | 10 |
A *repository* is a hosted collection of tagged :ref:`images |
| 11 | 11 |
<image_def>` that together create the file system for a container. The |