| ... | ... |
@@ -5,8 +5,9 @@ RUN svn checkout https://github.com/docker/compose/trunk/docs /docs/content/comp |
| 5 | 5 |
RUN svn checkout https://github.com/docker/swarm/trunk/docs /docs/content/swarm |
| 6 | 6 |
RUN svn checkout https://github.com/docker/machine/trunk/docs /docs/content/machine |
| 7 | 7 |
RUN svn checkout https://github.com/docker/distribution/trunk/docs /docs/content/registry |
| 8 |
-RUN svn checkout https://github.com/kitematic/kitematic/trunk/docs /docs/content/kitematic |
|
| 9 |
-RUN svn checkout https://github.com/docker/tutorials/trunk/docs /docs/content/ |
|
| 8 |
+RUN svn checkout https://github.com/docker/notary/trunk/docs /docs/content/notary |
|
| 9 |
+RUN svn checkout https://github.com/docker/kitematic/trunk/docs /docs/content/kitematic |
|
| 10 |
+RUN svn checkout https://github.com/docker/toolbox/trunk/docs /docs/content/toolbox |
|
| 10 | 11 |
RUN svn checkout https://github.com/docker/opensource/trunk/docs /docs/content/opensource |
| 11 | 12 |
|
| 12 | 13 |
ENV PROJECT=engine |
| ... | ... |
@@ -53,6 +53,10 @@ The following plugins exist: |
| 53 | 53 |
another volume plugin that provides multi-host volumes management for Docker |
| 54 | 54 |
using GlusterFS. |
| 55 | 55 |
|
| 56 |
+* The [Horcrux Volume Plugin](https://github.com/muthu-r/horcrux) allows on-demand, |
|
| 57 |
+ version controlled access to your data. Horcrux is an open-source plugin, |
|
| 58 |
+ written in Go, and supports SCP, [Minio](https://www.minio.io) and Amazon S3. |
|
| 59 |
+ |
|
| 56 | 60 |
* The [IPFS Volume Plugin](http://github.com/vdemeester/docker-volume-ipfs) |
| 57 | 61 |
is an open source volume plugin that allows using an |
| 58 | 62 |
[ipfs](https://ipfs.io/) filesystem as a volume. |
| ... | ... |
@@ -1,6 +1,6 @@ |
| 1 | 1 |
<!--[metadata]> |
| 2 | 2 |
+++ |
| 3 |
-title = "Example: Manual install on a cloud provider" |
|
| 3 |
+title = "Example: Manual install on cloud provider" |
|
| 4 | 4 |
description = "Example of a manual install of Docker Engine on a cloud provider, using Amazon Web Services (AWS) EC2. Shows how to create an EC2 instance, and install Docker Engine on it." |
| 5 | 5 |
keywords = ["cloud, docker, machine, documentation, installation, AWS, EC2"] |
| 6 | 6 |
[menu.main] |
| ... | ... |
@@ -8,7 +8,7 @@ parent = "install_cloud" |
| 8 | 8 |
+++ |
| 9 | 9 |
<![end-metadata]--> |
| 10 | 10 |
|
| 11 |
-# Example: Manual install on a cloud provider |
|
| 11 |
+# Example: Manual install on cloud provider |
|
| 12 | 12 |
|
| 13 | 13 |
You can install Docker Engine directly to servers you have on cloud providers. This example shows how to create an <a href="https://aws.amazon.com/" target="_blank"> Amazon Web Services (AWS)</a> EC2 instance, and install Docker Engine on it. |
| 14 | 14 |
|
| ... | ... |
@@ -197,8 +197,12 @@ For Ubuntu Trusty (and some other versions), it’s recommended to install the ` |
| 197 | 197 |
|
| 198 | 198 |
## Where to go next |
| 199 | 199 |
|
| 200 |
-* Would you like a quicker way to do Docker cloud installs? See [Digital Ocean Example: Use Docker Machine to provision Docker on cloud hosts](cloud-ex-aws.md). |
|
| 200 |
+_Looking for a quicker way to do Docker cloud installs and provision multiple hosts?_ You can use [Docker Machine](https://docs.docker.com/machine/overview/) to provision hosts. |
|
| 201 | 201 |
|
| 202 |
-* To learn more about options for installing Docker Engine on cloud providers, see [Understand cloud install options and choose one](cloud.md). |
|
| 202 |
+ * [Use Docker Machine to provision hosts on cloud providers](https://docs.docker.com/machine/get-started-cloud/) |
|
| 203 | 203 |
|
| 204 |
-* To get started with Docker, see <a href="https://docs.docker.com/engine/userguide/" target="_blank"> Docker User Guide </a>. |
|
| 204 |
+ * [Docker Machine driver reference](https://docs.docker.com/machine/drivers/) |
|
| 205 |
+ |
|
| 206 |
+* [Install Docker Engine](../index.md) |
|
| 207 |
+ |
|
| 208 |
+* [Docker User Guide](../../userguide/intro.md) |
| ... | ... |
@@ -14,7 +14,7 @@ Docker Machine driver plugins are available for many cloud platforms, so you can |
| 14 | 14 |
|
| 15 | 15 |
You'll need to install and run Docker Machine, and create an account with the cloud provider. |
| 16 | 16 |
|
| 17 |
-Then you provide account verification, security credentials, and configuration options for the providers as flags to `docker-machine create`. The flags are unique for each cloud-specific driver. For instance, to pass a Digital Ocean access token you use the `--digitalocean-access-token` flag. |
|
| 17 |
+Then you provide account verification, security credentials, and configuration options for the providers as flags to `docker-machine create`. The flags are unique for each cloud-specific driver. For instance, to pass a Digital Ocean access token, you use the `--digitalocean-access-token` flag. |
|
| 18 | 18 |
|
| 19 | 19 |
As an example, let's take a look at how to create a Dockerized <a href="https://digitalocean.com" target="_blank">Digital Ocean</a> _Droplet_ (cloud server). |
| 20 | 20 |
|
| ... | ... |
@@ -44,7 +44,7 @@ To generate your access token: |
| 44 | 44 |
|
| 45 | 45 |
This is the personal access token you'll use in the next step to create your cloud server. |
| 46 | 46 |
|
| 47 |
-### Step 3. Start Docker Machine |
|
| 47 |
+### Step 3. Install Docker Machine |
|
| 48 | 48 |
|
| 49 | 49 |
1. If you have not done so already, install Docker Machine on your local host. |
| 50 | 50 |
|
| ... | ... |
@@ -57,30 +57,6 @@ To generate your access token: |
| 57 | 57 |
2. At a command terminal, use `docker-machine ls` to get a list of Docker Machines and their status. |
| 58 | 58 |
|
| 59 | 59 |
$ docker-machine ls |
| 60 |
- NAME ACTIVE DRIVER STATE URL SWARM |
|
| 61 |
- default - virtualbox Stopped |
|
| 62 |
- |
|
| 63 |
-3. If Machine is stopped, start it. |
|
| 64 |
- |
|
| 65 |
- $ docker-machine start default |
|
| 66 |
- (default) OUT | Starting VM... |
|
| 67 |
- Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command. |
|
| 68 |
- |
|
| 69 |
-4. Set environment variables to connect your shell to the local VM. |
|
| 70 |
- |
|
| 71 |
- $ docker-machine env default |
|
| 72 |
- export DOCKER_TLS_VERIFY="1" |
|
| 73 |
- export DOCKER_HOST="tcp://xxx.xxx.xx.xxx:xxxx" |
|
| 74 |
- export DOCKER_CERT_PATH="/Users/londoncalling/.docker/machine/machines/default" |
|
| 75 |
- export DOCKER_MACHINE_NAME="default" |
|
| 76 |
- # Run this command to configure your shell: |
|
| 77 |
- # eval "$(docker-machine env default)" |
|
| 78 |
- |
|
| 79 |
- eval "$(docker-machine env default)" |
|
| 80 |
- |
|
| 81 |
-5. Re-run `docker-machine ls` to check that it's now running. |
|
| 82 |
- |
|
| 83 |
- $ docker-machine ls |
|
| 84 | 60 |
NAME ACTIVE DRIVER STATE URL SWARM |
| 85 | 61 |
default * virtualbox Running tcp:////xxx.xxx.xx.xxx:xxxx |
| 86 | 62 |
|
| ... | ... |
@@ -92,28 +68,15 @@ To generate your access token: |
| 92 | 92 |
|
| 93 | 93 |
Hello from Docker. |
| 94 | 94 |
This message shows that your installation appears to be working correctly. |
| 95 |
+ ... |
|
| 95 | 96 |
|
| 96 |
- To generate this message, Docker took the following steps: |
|
| 97 |
- 1. The Docker client contacted the Docker daemon. |
|
| 98 |
- 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. |
|
| 99 |
- 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. |
|
| 100 |
- 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. |
|
| 101 |
- |
|
| 102 |
- To try something more ambitious, you can run an Ubuntu container with: |
|
| 103 |
- $ docker run -it ubuntu bash |
|
| 104 |
- |
|
| 105 |
- Share images, automate workflows, and more with a free Docker Hub account: https://hub.docker.com |
|
| 106 |
- |
|
| 107 |
- For more examples and ideas, visit: |
|
| 108 |
- https://docs.docker.com/userguide/ |
|
| 109 |
- |
|
| 110 |
-### Step 4. Use Docker Machine to Create the Droplet |
|
| 97 |
+### Step 4. Use Machine to Create the Droplet |
|
| 111 | 98 |
|
| 112 | 99 |
1. Run `docker-machine create` with the `digitalocean` driver and pass your key to the `--digitalocean-access-token` flag, along with a name for the new cloud server. |
| 113 | 100 |
|
| 114 | 101 |
For this example, we'll call our new Droplet "docker-sandbox". |
| 115 | 102 |
|
| 116 |
- $ docker-machine create --driver digitalocean --digitalocean-access-token 455275108641c7716462d6f35d08b76b246b6b6151a816cf75de63c5ef918872 docker-sandbox |
|
| 103 |
+ $ docker-machine create --driver digitalocean --digitalocean-access-token xxxxx docker-sandbox |
|
| 117 | 104 |
Running pre-create checks... |
| 118 | 105 |
Creating machine... |
| 119 | 106 |
(docker-sandbox) OUT | Creating SSH key... |
| ... | ... |
@@ -163,45 +126,52 @@ To generate your access token: |
| 163 | 163 |
default - virtualbox Running tcp://192.168.99.100:2376 |
| 164 | 164 |
docker-sandbox * digitalocean Running tcp://45.55.222.72:2376 |
| 165 | 165 |
|
| 166 |
-6. Log in to the Droplet with the `docker-machine ssh` command. |
|
| 167 |
- |
|
| 168 |
- $ docker-machine ssh docker-sandbox |
|
| 169 |
- Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-71-generic x86_64) |
|
| 166 |
+6. Run some `docker-machine` commands to inspect the remote host. For example, `docker-machine ip <machine>` gets the host IP adddress and `docker-machine inspect <machine>` lists all the details. |
|
| 170 | 167 |
|
| 171 |
- * Documentation: https://help.ubuntu.com/ |
|
| 168 |
+ $ docker-machine ip docker-sandbox |
|
| 169 |
+ 104.131.43.236 |
|
| 172 | 170 |
|
| 173 |
- System information as of Mon Dec 21 21:38:53 EST 2015 |
|
| 171 |
+ $ docker-machine inspect docker-sandbox |
|
| 172 |
+ {
|
|
| 173 |
+ "ConfigVersion": 3, |
|
| 174 |
+ "Driver": {
|
|
| 175 |
+ "IPAddress": "104.131.43.236", |
|
| 176 |
+ "MachineName": "docker-sandbox", |
|
| 177 |
+ "SSHUser": "root", |
|
| 178 |
+ "SSHPort": 22, |
|
| 179 |
+ "SSHKeyPath": "/Users/samanthastevens/.docker/machine/machines/docker-sandbox/id_rsa", |
|
| 180 |
+ "StorePath": "/Users/samanthastevens/.docker/machine", |
|
| 181 |
+ "SwarmMaster": false, |
|
| 182 |
+ "SwarmHost": "tcp://0.0.0.0:3376", |
|
| 183 |
+ "SwarmDiscovery": "", |
|
| 184 |
+ ... |
|
| 174 | 185 |
|
| 175 |
- System load: 0.77 Processes: 70 |
|
| 176 |
- Usage of /: 11.4% of 19.56GB Users logged in: 0 |
|
| 177 |
- Memory usage: 15% IP address for eth0: 45.55.139.48 |
|
| 178 |
- Swap usage: 0% IP address for docker0: 172.17.0.1 |
|
| 186 |
+7. Verify Docker Engine is installed correctly by running `docker` commands. |
|
| 179 | 187 |
|
| 180 |
- Graph this data and manage this system at: |
|
| 181 |
- https://landscape.canonical.com/ |
|
| 188 |
+ Start with something basic like `docker run hello-world`, or for a more interesting test, run a Dockerized webserver on your new remote machine. |
|
| 182 | 189 |
|
| 183 |
-7. Verify Docker Engine is installed correctly by running `docker run hello-world`. |
|
| 190 |
+ In this example, the `-p` option is used to expose port 80 from the `nginx` container and make it accessible on port `8000` of the `docker-sandbox` host. |
|
| 184 | 191 |
|
| 185 |
- ubuntu@ip-172-31-0-151:~$ sudo docker run hello-world |
|
| 186 |
- Unable to find image 'hello-world:latest' locally |
|
| 187 |
- latest: Pulling from library/hello-world |
|
| 188 |
- b901d36b6f2f: Pull complete |
|
| 189 |
- 0a6ba66e537a: Pull complete |
|
| 190 |
- Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7 |
|
| 191 |
- Status: Downloaded newer image for hello-world:latest |
|
| 192 |
+ $ docker run -d -p 8000:80 --name webserver kitematic/hello-world-nginx |
|
| 193 |
+ Unable to find image 'kitematic/hello-world-nginx:latest' locally |
|
| 194 |
+ latest: Pulling from kitematic/hello-world-nginx |
|
| 195 |
+ a285d7f063ea: Pull complete |
|
| 196 |
+ 2d7baf27389b: Pull complete |
|
| 197 |
+ ... |
|
| 198 |
+ Digest: sha256:ec0ca6dcb034916784c988b4f2432716e2e92b995ac606e080c7a54b52b87066 |
|
| 199 |
+ Status: Downloaded newer image for kitematic/hello-world-nginx:latest |
|
| 200 |
+ 942dfb4a0eaae75bf26c9785ade4ff47ceb2ec2a152be82b9d7960e8b5777e65 |
|
| 192 | 201 |
|
| 193 |
- Hello from Docker. |
|
| 194 |
- This message shows that your installation appears to be working correctly. |
|
| 195 |
- . . . |
|
| 202 |
+ In a web browser, go to `http://<host_ip>:8000` to bring up the webserver home page. You got the `<host_ip>` from the output of the `docker-machine ip <machine>` command you ran in a previous step. Use the port you exposed in the `docker run` command. |
|
| 196 | 203 |
|
| 197 |
- You can type keyboard command Control-D or `exit` to log out of the remote server. |
|
| 204 |
+  |
|
| 198 | 205 |
|
| 199 | 206 |
#### Understand the defaults and options on the create command |
| 200 | 207 |
|
| 201 | 208 |
For convenience, `docker-machine` will use sensible defaults for choosing settings such as the image that the server is based on, but you override the defaults using the respective flags (e.g. `--digitalocean-image`). This is useful if, for example, you want to create a cloud server with a lot of memory and CPUs (by default `docker-machine` creates a small server). For a full list of the flags/settings available and their defaults, see the output of `docker-machine create -h` at the command line. See also <a href="https://docs.docker.com/machine/drivers/os-base/" target="_blank">Driver options and operating system defaults</a> and information about the <a href="https://docs.docker.com/machine/reference/create/" target="_blank">create</a> command in the Docker Machine documentation. |
| 202 | 209 |
|
| 203 | 210 |
|
| 204 |
-### Step 5. Use Docker Machine to remove the Droplet |
|
| 211 |
+### Step 5. Use Machine to remove the Droplet |
|
| 205 | 212 |
|
| 206 | 213 |
To remove a host and all of its containers and images, first stop the machine, then use `docker-machine rm`: |
| 207 | 214 |
|
| ... | ... |
@@ -220,8 +190,12 @@ If you create a host with Docker Machine, but remove it through the cloud provid |
| 220 | 220 |
|
| 221 | 221 |
## Where to go next |
| 222 | 222 |
|
| 223 |
-* To learn more about options for installing Docker Engine on cloud providers, see [Understand cloud install options and choose one](cloud.md). |
|
| 223 |
+* [Docker Machine driver reference](https://docs.docker.com/machine/drivers/) |
|
| 224 |
+ |
|
| 225 |
+* [Docker Machine Overview](https://docs.docker.com/machine/overview/) |
|
| 226 |
+ |
|
| 227 |
+* [Use Docker Machine to provision hosts on cloud providers](https://docs.docker.com/machine/get-started-cloud/) |
|
| 224 | 228 |
|
| 225 |
-* To learn more about using Docker Machine to provision cloud hosts, see <a href="https://docs.docker.com/machine/get-started-cloud/" target="_blank">Using Docker Machine with a cloud provider</a>. |
|
| 229 |
+* [Install Docker Engine](../../installation/index.md) |
|
| 226 | 230 |
|
| 227 |
-* To get started with Docker, see <a href="https://docs.docker.com/engine/userguide/" target="_blank"> Docker User Guide</a>. |
|
| 231 |
+* [Docker User Guide](../../userguide/intro.md) |
| 228 | 232 |
deleted file mode 100644 |
| ... | ... |
@@ -1,53 +0,0 @@ |
| 1 |
-<!--[metadata]> |
|
| 2 |
-+++ |
|
| 3 |
-title = "Choose how to install" |
|
| 4 |
-description = "Installation instructions for Docker on cloud." |
|
| 5 |
-keywords = ["cloud, docker, machine, documentation, installation"] |
|
| 6 |
-[menu.main] |
|
| 7 |
-parent = "install_cloud" |
|
| 8 |
-weight=-3 |
|
| 9 |
-+++ |
|
| 10 |
-<![end-metadata]--> |
|
| 11 |
- |
|
| 12 |
-# Understand cloud install options and choose one |
|
| 13 |
- |
|
| 14 |
-You can install Docker Engine on any cloud platform that runs an operating system (OS) that Docker supports. This includes many flavors and versions of Linux, along with Mac and Windows. |
|
| 15 |
- |
|
| 16 |
-You have two options for installing: |
|
| 17 |
- |
|
| 18 |
-* Manually install on the cloud (create cloud hosts, then install Docker Engine on them) |
|
| 19 |
-* Use Docker Machine to provision cloud hosts |
|
| 20 |
- |
|
| 21 |
-## Manually install Docker Engine on a cloud host |
|
| 22 |
- |
|
| 23 |
-To install on a cloud provider: |
|
| 24 |
- |
|
| 25 |
-1. Create an account with the cloud provider, and read cloud provider documentation to understand their process for creating hosts. |
|
| 26 |
- |
|
| 27 |
-2. Decide which OS you want to run on the cloud host. |
|
| 28 |
- |
|
| 29 |
-3. Understand the Docker prerequisites and install process for the chosen OS. See [Install Docker Engine](index.md) for a list of supported systems and links to the install guides. |
|
| 30 |
- |
|
| 31 |
-4. Create a host with a Docker supported OS, and install Docker per the instructions for that OS. |
|
| 32 |
- |
|
| 33 |
-[Example: Manual install on a cloud provider](cloud-ex-aws.md) shows how to create an <a href="https://aws.amazon.com/" target="_blank"> Amazon Web Services (AWS)</a> EC2 instance, and install Docker Engine on it. |
|
| 34 |
- |
|
| 35 |
- |
|
| 36 |
-## Use Docker Machine to provision cloud hosts |
|
| 37 |
- |
|
| 38 |
-Docker Machine driver plugins are available for several popular cloud platforms, so you can use Machine to provision one or more Dockerized hosts on those platforms. |
|
| 39 |
- |
|
| 40 |
-With Docker Machine, you can use the same interface to create cloud hosts with Docker Engine on them, each configured per the options you specify. |
|
| 41 |
- |
|
| 42 |
-To do this, you use the `docker-machine create` command with the driver for the cloud provider, and provider-specific flags for account verification, security credentials, and other configuration details. |
|
| 43 |
- |
|
| 44 |
-[Example: Use Docker Machine to provision cloud hosts](cloud-ex-machine-ocean.md) walks you through the steps to set up Docker Machine and provision a Dockerized host on [Digital Ocean](https://www.digitalocean.com/). |
|
| 45 |
- |
|
| 46 |
-## Where to go next |
|
| 47 |
-* [Example: Manual install on a cloud provider](cloud-ex-aws.md) (AWS EC2) |
|
| 48 |
- |
|
| 49 |
-* [Example: Use Docker Machine to provision cloud hosts](cloud-ex-machine-ocean.md) (Digital Ocean) |
|
| 50 |
- |
|
| 51 |
-* [Using Docker Machine with a cloud provider](https://docs.docker.com/machine/get-started-cloud/) |
|
| 52 |
- |
|
| 53 |
-* <a href="https://docs.docker.com/engine/userguide/" target="_blank"> Docker User Guide </a> (after your install is complete, get started using Docker) |
| ... | ... |
@@ -8,7 +8,7 @@ aliases = [ |
| 8 | 8 |
"/engine/installation/rackspace/", |
| 9 | 9 |
"/engine/installation/joyent/" |
| 10 | 10 |
] |
| 11 |
-title = "In the cloud" |
|
| 11 |
+title = "On cloud providers" |
|
| 12 | 12 |
description = "Cloud Installations" |
| 13 | 13 |
keywords = ["Docker install "] |
| 14 | 14 |
[menu.main] |
| ... | ... |
@@ -20,6 +20,6 @@ weight="-60" |
| 20 | 20 |
|
| 21 | 21 |
# Install Engine in the cloud |
| 22 | 22 |
|
| 23 |
-* [Understand cloud install options and choose one](cloud.md) |
|
| 24 |
-* [Example: Use Docker Machine to provision cloud hosts](cloud-ex-machine-ocean.md) |
|
| 23 |
+* [Understand cloud install options and choose one](overview.md) |
|
| 24 |
+* [Example: Use Machine to provision cloud hosts](cloud-ex-machine-ocean.md) |
|
| 25 | 25 |
* [Example: Manual install on a cloud provider](cloud-ex-aws.md) |
| 26 | 26 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,56 @@ |
| 0 |
+<!--[metadata]> |
|
| 1 |
+aliases = [ |
|
| 2 |
+ "/engine/installation/cloud/cloud/", |
|
| 3 |
+] |
|
| 4 |
+title = "Choose how to install" |
|
| 5 |
+description = "Installation instructions for Docker on cloud." |
|
| 6 |
+keywords = ["cloud, docker, machine, documentation, installation"] |
|
| 7 |
+[menu.main] |
|
| 8 |
+parent = "install_cloud" |
|
| 9 |
+weight=-3 |
|
| 10 |
+<![end-metadata]--> |
|
| 11 |
+ |
|
| 12 |
+# Choose how to install |
|
| 13 |
+ |
|
| 14 |
+You can install Docker Engine on any cloud platform that runs an operating system (OS) that Docker supports. This includes many flavors and versions of Linux, along with Mac and Windows. |
|
| 15 |
+ |
|
| 16 |
+You have two options for installing: |
|
| 17 |
+ |
|
| 18 |
+* Manually install on the cloud (create cloud hosts, then install Docker Engine on them) |
|
| 19 |
+* Use Docker Machine to provision cloud hosts |
|
| 20 |
+ |
|
| 21 |
+## Manually install Docker Engine on a cloud host |
|
| 22 |
+ |
|
| 23 |
+To install on a cloud provider: |
|
| 24 |
+ |
|
| 25 |
+1. Create an account with the cloud provider, and read cloud provider documentation to understand their process for creating hosts. |
|
| 26 |
+ |
|
| 27 |
+2. Decide which OS you want to run on the cloud host. |
|
| 28 |
+ |
|
| 29 |
+3. Understand the Docker prerequisites and install process for the chosen OS. See [Install Docker Engine](../index.md) for a list of supported systems and links to the install guides. |
|
| 30 |
+ |
|
| 31 |
+4. Create a host with a Docker supported OS, and install Docker per the instructions for that OS. |
|
| 32 |
+ |
|
| 33 |
+[Example (AWS): Manual install on a cloud provider](cloud-ex-aws.md) shows how to create an <a href="https://aws.amazon.com/" target="_blank"> Amazon Web Services (AWS)</a> EC2 instance, and install Docker Engine on it. |
|
| 34 |
+ |
|
| 35 |
+ |
|
| 36 |
+## Use Docker Machine to provision cloud hosts |
|
| 37 |
+ |
|
| 38 |
+Docker Machine driver plugins are available for several popular cloud platforms, so you can use Machine to provision one or more Dockerized hosts on those platforms. |
|
| 39 |
+ |
|
| 40 |
+With Docker Machine, you can use the same interface to create cloud hosts with Docker Engine on them, each configured per the options you specify. |
|
| 41 |
+ |
|
| 42 |
+To do this, you use the `docker-machine create` command with the driver for the cloud provider, and provider-specific flags for account verification, security credentials, and other configuration details. |
|
| 43 |
+ |
|
| 44 |
+[Example: Use Docker Machine to provision cloud hosts](cloud-ex-machine-ocean.md) walks you through the steps to set up Docker Machine and provision a Dockerized host on <a href="https://www.digitalocean.com/" target="_blank">Digital Ocean</a>). |
|
| 45 |
+ |
|
| 46 |
+## Where to go next |
|
| 47 |
+* [Example: Manual install on a cloud provider](cloud-ex-aws.md) (AWS EC2) |
|
| 48 |
+ |
|
| 49 |
+* [Example: Use Docker Machine to provision cloud hosts](cloud-ex-machine-ocean.md) (Digital Ocean) |
|
| 50 |
+ |
|
| 51 |
+* For supported platforms, see [Install Docker Engine](../index.md). |
|
| 52 |
+ |
|
| 53 |
+* To get started with Docker post-install, see [Docker User Guide](../../userguide/intro.md). |
| ... | ... |
@@ -30,7 +30,7 @@ Docker Engine is supported on Linux, Cloud, Windows, and OS X. Installation inst |
| 30 | 30 |
If your linux distribution is not listed above, don't give up yet. To try out Docker on a distribution that is not listed above, go here: [Installation from binaries](binaries.md). |
| 31 | 31 |
|
| 32 | 32 |
## On Cloud |
| 33 |
-* [Choose how to Install](cloud/cloud.md) |
|
| 33 |
+* [Choose how to Install](cloud/overview.md) |
|
| 34 | 34 |
* [Example: Manual install on a cloud provider](cloud/cloud-ex-aws.md) |
| 35 | 35 |
* [Example: Use Docker Machine to provision cloud hosts](cloud/cloud-ex-machine-ocean.md) |
| 36 | 36 |
|
| ... | ... |
@@ -387,7 +387,7 @@ The next exercise demonstrates how to do this. |
| 387 | 387 |
|
| 388 | 388 |
## Upgrade Docker Toolbox |
| 389 | 389 |
|
| 390 |
-To upgrade Docker Toolbox, download an re-run [the Docker Toolbox |
|
| 390 |
+To upgrade Docker Toolbox, download and re-run [the Docker Toolbox |
|
| 391 | 391 |
installer](https://docker.com/toolbox/). |
| 392 | 392 |
|
| 393 | 393 |
|
| ... | ... |
@@ -324,7 +324,7 @@ and what it does: |
| 324 | 324 |
|
| 325 | 325 |
## Upgrade Docker Toolbox |
| 326 | 326 |
|
| 327 |
-To upgrade Docker Toolbox, download an re-run [the Docker Toolbox |
|
| 327 |
+To upgrade Docker Toolbox, download and re-run [the Docker Toolbox |
|
| 328 | 328 |
installer](https://www.docker.com/toolbox). |
| 329 | 329 |
|
| 330 | 330 |
## Container port redirection |
| ... | ... |
@@ -24,9 +24,20 @@ client must have `root` access to interact with the daemon. If a group named |
| 24 | 24 |
`docker` exists on your system, `docker` applies ownership of the socket to the |
| 25 | 25 |
group. |
| 26 | 26 |
|
| 27 |
-The current version of the API is v1.22 which means calling `/info` is the same |
|
| 28 |
-as calling `/v1.22/info`. To call an older version of the API use |
|
| 29 |
-`/v1.21/info`. |
|
| 27 |
+To connect to the Docker daemon with cURL you need to use cURL 7.40 or |
|
| 28 |
+later, as these versions have the `--unix-socket` flag available. To |
|
| 29 |
+run `curl` against the deamon on the default socket, use the |
|
| 30 |
+following: |
|
| 31 |
+ |
|
| 32 |
+ curl --unix-socket /var/run/docker.sock http://containers/json |
|
| 33 |
+ |
|
| 34 |
+If you have bound the Docker daemon to a different socket path or TCP |
|
| 35 |
+port, you would reference that in your cURL rather than the |
|
| 36 |
+default. |
|
| 37 |
+ |
|
| 38 |
+The current version of the API is v1.23 which means calling `/info` is the same |
|
| 39 |
+as calling `/v1.23/info`. To call an older version of the API use |
|
| 40 |
+`/v1.22/info`. |
|
| 30 | 41 |
|
| 31 | 42 |
Use the table below to find the API version for a Docker version: |
| 32 | 43 |
|
| ... | ... |
@@ -93,7 +104,7 @@ Some container-related events are not affected by container state, so they are n |
| 93 | 93 |
|
| 94 | 94 |
Running `docker rmi` emits an **untag** event when removing an image name. The `rmi` command may also emit **delete** events when images are deleted by ID directly or by deleting the last tag referring to the image. |
| 95 | 95 |
|
| 96 |
-> **Acknowledgement**: This diagram and the accompanying text were used with the permission of Matt Good and Gilder Labs. See Matt's original blog post [Docker Events Explained](http://gliderlabs.com/blog/2015/04/14/docker-events-explained/). |
|
| 96 |
+> **Acknowledgement**: This diagram and the accompanying text were used with the permission of Matt Good and Gilder Labs. See Matt's original blog post [Docker Events Explained](https://gliderlabs.com/blog/2015/04/14/docker-events-explained/). |
|
| 97 | 97 |
|
| 98 | 98 |
## Version history |
| 99 | 99 |
|
| ... | ... |
@@ -124,6 +124,12 @@ will add the libraries here. |
| 124 | 124 |
</tr> |
| 125 | 125 |
<tr> |
| 126 | 126 |
<td>JavaScript (NodeJS)</td> |
| 127 |
+ <td>dockerizer</td> |
|
| 128 |
+ <td><a class="reference external" href="https://github.com/kesarion/dockerizer">https://github.com/kesarion/dockerizer</a></td> |
|
| 129 |
+ <td>Active</td> |
|
| 130 |
+ </tr> |
|
| 131 |
+ <tr> |
|
| 132 |
+ <td>JavaScript (NodeJS)</td> |
|
| 127 | 133 |
<td>dockerode</td> |
| 128 | 134 |
<td><a class="reference external" href="https://github.com/apocas/dockerode">https://github.com/apocas/dockerode</a> |
| 129 | 135 |
Install via NPM: <cite>npm install dockerode</cite></td> |
| ... | ... |
@@ -191,6 +197,12 @@ will add the libraries here. |
| 191 | 191 |
<td>Active</td> |
| 192 | 192 |
</tr> |
| 193 | 193 |
<tr> |
| 194 |
+ <td>PHP</td> |
|
| 195 |
+ <td>Docker-PHP-Client</td> |
|
| 196 |
+ <td><a class="reference external" href="https://github.com/jarkt/docker-php-client">https://github.com/jarkt/docker-php-client</a></td> |
|
| 197 |
+ <td>Active</td> |
|
| 198 |
+ </tr> |
|
| 199 |
+ <tr> |
|
| 194 | 200 |
<td>Python</td> |
| 195 | 201 |
<td>docker-py</td> |
| 196 | 202 |
<td><a class="reference external" href="https://github.com/docker/docker-py">https://github.com/docker/docker-py</a></td> |
| ... | ... |
@@ -54,7 +54,7 @@ the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of |
| 54 | 54 |
the following: |
| 55 | 55 |
|
| 56 | 56 |
* `a-z` (a single lowercase alpha character ) |
| 57 |
-* `@` (ampersand) |
|
| 57 |
+* `@` (at sign) |
|
| 58 | 58 |
* `[` (left bracket) |
| 59 | 59 |
* `\\` (two backward slashes) |
| 60 | 60 |
* `_` (underscore) |
| ... | ... |
@@ -111,7 +111,7 @@ property. The format of the `<sequence>` is a comma-separated list of either |
| 111 | 111 |
a letter [a-Z], or the `ctrl-` combined with any of the following: |
| 112 | 112 |
|
| 113 | 113 |
* `a-z` (a single lowercase alpha character ) |
| 114 |
-* `@` (ampersand) |
|
| 114 |
+* `@` (at sign) |
|
| 115 | 115 |
* `[` (left bracket) |
| 116 | 116 |
* `\\` (two backward slashes) |
| 117 | 117 |
* `_` (underscore) |
| ... | ... |
@@ -220,7 +220,8 @@ system's interfaces. |
| 220 | 220 |
|
| 221 | 221 |
$ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash |
| 222 | 222 |
|
| 223 |
-This sets environmental variables in the container. For illustration all three |
|
| 223 |
+This sets simple (non-array) environmental variables in the container. For |
|
| 224 |
+illustration all three |
|
| 224 | 225 |
flags are shown here. Where `-e`, `--env` take an environment variable and |
| 225 | 226 |
value, or if no `=` is provided, then that variable's current value is passed |
| 226 | 227 |
through (i.e. `$MYVAR1` from the host is set to `$MYVAR1` in the container). |
| ... | ... |
@@ -1049,8 +1049,8 @@ By default, the docker container process runs with the supplementary groups look |
| 1049 | 1049 |
up for the specified user. If one wants to add more to that list of groups, then |
| 1050 | 1050 |
one can use this flag: |
| 1051 | 1051 |
|
| 1052 |
- $ docker run -it --rm --group-add audio --group-add dbus --group-add 777 busybox id |
|
| 1053 |
- uid=0(root) gid=0(root) groups=10(wheel),29(audio),81(dbus),777 |
|
| 1052 |
+ $ docker run --rm --group-add audio --group-add nogroup --group-add 777 busybox id |
|
| 1053 |
+ uid=0(root) gid=0(root) groups=10(wheel),29(audio),99(nogroup),777 |
|
| 1054 | 1054 |
|
| 1055 | 1055 |
## Runtime privilege and Linux capabilities |
| 1056 | 1056 |
|
| ... | ... |
@@ -1059,6 +1059,14 @@ one can use this flag: |
| 1059 | 1059 |
--privileged=false: Give extended privileges to this container |
| 1060 | 1060 |
--device=[]: Allows you to run devices inside the container without the --privileged flag. |
| 1061 | 1061 |
|
| 1062 |
+> **Note:** |
|
| 1063 |
+> With Docker 1.10 and greater, the default seccomp profile will also block |
|
| 1064 |
+> syscalls, regardless of `--cap-add` passed to the container. We recommend in |
|
| 1065 |
+> these cases to create your own custom seccomp profile based off our |
|
| 1066 |
+> [default](https://github.com/docker/docker/blob/master/profiles/seccomp/default.json). |
|
| 1067 |
+> Or if you don't want to run with the default seccomp profile, you can pass |
|
| 1068 |
+> `--security-opt=seccomp:unconfined` on run. |
|
| 1069 |
+ |
|
| 1062 | 1070 |
By default, Docker containers are "unprivileged" and cannot, for |
| 1063 | 1071 |
example, run a Docker daemon inside a Docker container. This is because |
| 1064 | 1072 |
by default a container is not allowed to access any devices, but a |
| ... | ... |
@@ -1429,7 +1437,10 @@ The developer can set a default user to run the first process with the |
| 1429 | 1429 |
Dockerfile `USER` instruction. When starting a container, the operator can override |
| 1430 | 1430 |
the `USER` instruction by passing the `-u` option. |
| 1431 | 1431 |
|
| 1432 |
- -u="": Username or UID |
|
| 1432 |
+ -u="", --user="": Sets the username or UID used and optionally the groupname or GID for the specified command. |
|
| 1433 |
+ |
|
| 1434 |
+ The followings examples are all valid: |
|
| 1435 |
+ --user=[ user | user:group | uid | uid:gid | user:gid | uid:group ] |
|
| 1433 | 1436 |
|
| 1434 | 1437 |
> **Note:** if you pass a numeric uid, it must be in the range of 0-2147483647. |
| 1435 | 1438 |
|
| ... | ... |
@@ -126,8 +126,8 @@ On Windows, mount directories using: |
| 126 | 126 |
docker run -v /c/Users/<path>:/<container path> ...` |
| 127 | 127 |
``` |
| 128 | 128 |
|
| 129 |
-All other paths come from your virtual machine's filesystem. For example, if |
|
| 130 |
-you are using VirtualBox some other folder available for sharing, you need to do |
|
| 129 |
+All other paths come from your virtual machine's filesystem, so if you want |
|
| 130 |
+to make some other host folder available for sharing, you need to do |
|
| 131 | 131 |
additional work. In the case of VirtualBox you need to make the host folder |
| 132 | 132 |
available as a shared folder in VirtualBox. Then, you can mount it using the |
| 133 | 133 |
Docker `-v` flag. |
| ... | ... |
@@ -1,8 +1,8 @@ |
| 1 | 1 |
<!--[metadata]> |
| 2 | 2 |
+++ |
| 3 | 3 |
title = "User guide" |
| 4 |
-description = "Welcome to the user guide" |
|
| 5 |
-keywords = ["docker, introduction, documentation, about, technology, docker.io, user, guide, user's, manual, platform, framework, home, intro"] |
|
| 4 |
+description = "How to use the Docker Engine user guide" |
|
| 5 |
+keywords = ["engine, introduction, documentation, about, technology, docker, user, guide, framework, home, intro"] |
|
| 6 | 6 |
[menu.main] |
| 7 | 7 |
parent="engine_use" |
| 8 | 8 |
identifier = "engine_guide" |
| ... | ... |
@@ -10,4 +10,54 @@ weight="-80" |
| 10 | 10 |
+++ |
| 11 | 11 |
<![end-metadata]--> |
| 12 | 12 |
|
| 13 |
-# User guide |
|
| 13 |
+# Docker Engine user guide |
|
| 14 |
+ |
|
| 15 |
+This guide helps users learn how to use Docker Engine. |
|
| 16 |
+ |
|
| 17 |
+- [Introduction to Engine user guide](intro.md) |
|
| 18 |
+ |
|
| 19 |
+## Learn by example |
|
| 20 |
+ |
|
| 21 |
+- [Hello world in a container](containers/dockerizing.md) |
|
| 22 |
+- [Build your own images](containers/dockerimages.md) |
|
| 23 |
+- [Network containers](containers/networkingcontainers.md) |
|
| 24 |
+- [Run a simple application](containers/usingdocker.md) |
|
| 25 |
+- [Manage data in containers](containers/dockervolumes.md) |
|
| 26 |
+- [Store images on Docker Hub](containers/dockerrepos.md) |
|
| 27 |
+ |
|
| 28 |
+## Work with images |
|
| 29 |
+ |
|
| 30 |
+- [Best practices for writing Dockerfiles](eng-image/dockerfile_best-practices.md) |
|
| 31 |
+- [Create a base image](eng-image/baseimages.md) |
|
| 32 |
+- [Image management](eng-image/image_management.md) |
|
| 33 |
+ |
|
| 34 |
+## Manage storage drivers |
|
| 35 |
+ |
|
| 36 |
+- [Understand images, containers, and storage drivers](storagedriver/imagesandcontainers.md) |
|
| 37 |
+- [Select a storage driver](storagedriver/selectadriver.md) |
|
| 38 |
+- [AUFS storage in practice](storagedriver/aufs-driver.md) |
|
| 39 |
+- [Btrfs storage in practice](storagedriver/btrfs-driver.md) |
|
| 40 |
+- [Device Mapper storage in practice](storagedriver/device-mapper-driver.md) |
|
| 41 |
+- [OverlayFS storage in practice](storagedriver/overlayfs-driver.md) |
|
| 42 |
+- [ZFS storage in practice](storagedriver/zfs-driver.md) |
|
| 43 |
+ |
|
| 44 |
+## Configure networks |
|
| 45 |
+ |
|
| 46 |
+- [Understand Docker container networks](networking/dockernetworks.md) |
|
| 47 |
+- [Embedded DNS server in user-defined networks](networking/configure-dns.md) |
|
| 48 |
+- [Get started with multi-host networking](networking/get-started-overlay.md) |
|
| 49 |
+- [Work with network commands](networking/work-with-networks.md) |
|
| 50 |
+ |
|
| 51 |
+### Work with the default network |
|
| 52 |
+ |
|
| 53 |
+- [Understand container communication](networking/default_network/container-communication.md) |
|
| 54 |
+- [Legacy container links](networking/default_network/dockerlinks.md) |
|
| 55 |
+- [Binding container ports to the host](networking/default_network/binding.md) |
|
| 56 |
+- [Build your own bridge](networking/default_network/build-bridges.md) |
|
| 57 |
+- [Configure container DNS](networking/default_network/configure-dns.md) |
|
| 58 |
+- [Customize the docker0 bridge](networking/default_network/custom-docker0.md) |
|
| 59 |
+- [IPv6 with Docker](networking/default_network/ipv6.md) |
|
| 60 |
+ |
|
| 61 |
+## Misc |
|
| 62 |
+ |
|
| 63 |
+- [Apply custom metadata](labels-custom-metadata.md) |
| 14 | 64 |
deleted file mode 100644 |
| ... | ... |
@@ -1,141 +0,0 @@ |
| 1 |
-<!--[metadata]> |
|
| 2 |
-+++ |
|
| 3 |
-draft=true |
|
| 4 |
-title = "Tools and Examples" |
|
| 5 |
-keywords = ["docker, bridge, docker0, network"] |
|
| 6 |
-[menu.main] |
|
| 7 |
-parent = "smn_networking_def" |
|
| 8 |
-+++ |
|
| 9 |
-<![end-metadata]--> |
|
| 10 |
- |
|
| 11 |
-<!--[metadata]> |
|
| 12 |
-We may want to add it back in later under another form. Labeled DRAFT for now. Won't be built. |
|
| 13 |
-<![end-metadata]--> |
|
| 14 |
- |
|
| 15 |
-# Quick guide to the options |
|
| 16 |
-Here is a quick list of the networking-related Docker command-line options, in case it helps you find the section below that you are looking for. |
|
| 17 |
- |
|
| 18 |
-Some networking command-line options can only be supplied to the Docker server when it starts up, and cannot be changed once it is running: |
|
| 19 |
-- `-b BRIDGE` or `--bridge=BRIDGE` -- see |
|
| 20 |
- |
|
| 21 |
- [Building your own bridge](#bridge-building) |
|
| 22 |
- |
|
| 23 |
-- `--bip=CIDR` -- see |
|
| 24 |
- |
|
| 25 |
- [Customizing docker0](#docker0) |
|
| 26 |
- |
|
| 27 |
-- `--default-gateway=IP_ADDRESS` -- see |
|
| 28 |
- |
|
| 29 |
- [How Docker networks a container](#container-networking) |
|
| 30 |
- |
|
| 31 |
-- `--default-gateway-v6=IP_ADDRESS` -- see |
|
| 32 |
- |
|
| 33 |
- [IPv6](#ipv6) |
|
| 34 |
- |
|
| 35 |
-- `--fixed-cidr` -- see |
|
| 36 |
- |
|
| 37 |
- [Customizing docker0](#docker0) |
|
| 38 |
- |
|
| 39 |
-- `--fixed-cidr-v6` -- see |
|
| 40 |
- |
|
| 41 |
- [IPv6](#ipv6) |
|
| 42 |
- |
|
| 43 |
-- `-H SOCKET...` or `--host=SOCKET...` -- |
|
| 44 |
- |
|
| 45 |
- This might sound like it would affect container networking, |
|
| 46 |
- |
|
| 47 |
- but it actually faces in the other direction: |
|
| 48 |
- |
|
| 49 |
- it tells the Docker server over what channels |
|
| 50 |
- |
|
| 51 |
- it should be willing to receive commands |
|
| 52 |
- |
|
| 53 |
- like "run container" and "stop container." |
|
| 54 |
- |
|
| 55 |
-- `--icc=true|false` -- see |
|
| 56 |
- |
|
| 57 |
- [Communication between containers](#between-containers) |
|
| 58 |
- |
|
| 59 |
-- `--ip=IP_ADDRESS` -- see |
|
| 60 |
- |
|
| 61 |
- [Binding container ports](#binding-ports) |
|
| 62 |
- |
|
| 63 |
-- `--ipv6=true|false` -- see |
|
| 64 |
- |
|
| 65 |
- [IPv6](#ipv6) |
|
| 66 |
- |
|
| 67 |
-- `--ip-forward=true|false` -- see |
|
| 68 |
- |
|
| 69 |
- [Communication between containers and the wider world](#the-world) |
|
| 70 |
- |
|
| 71 |
-- `--iptables=true|false` -- see |
|
| 72 |
- |
|
| 73 |
- [Communication between containers](#between-containers) |
|
| 74 |
- |
|
| 75 |
-- `--mtu=BYTES` -- see |
|
| 76 |
- |
|
| 77 |
- [Customizing docker0](#docker0) |
|
| 78 |
- |
|
| 79 |
-- `--userland-proxy=true|false` -- see |
|
| 80 |
- |
|
| 81 |
- [Binding container ports](#binding-ports) |
|
| 82 |
- |
|
| 83 |
-There are three networking options that can be supplied either at startup or when `docker run` is invoked. When provided at startup, set the default value that `docker run` will later use if the options are not specified: |
|
| 84 |
-- `--dns=IP_ADDRESS...` -- see |
|
| 85 |
- |
|
| 86 |
- [Configuring DNS](#dns) |
|
| 87 |
- |
|
| 88 |
-- `--dns-search=DOMAIN...` -- see |
|
| 89 |
- |
|
| 90 |
- [Configuring DNS](#dns) |
|
| 91 |
- |
|
| 92 |
-- `--dns-opt=OPTION...` -- see |
|
| 93 |
- |
|
| 94 |
- [Configuring DNS](#dns) |
|
| 95 |
- |
|
| 96 |
-Finally, several networking options can only be provided when calling `docker run` because they specify something specific to one container: |
|
| 97 |
-- `-h HOSTNAME` or `--hostname=HOSTNAME` -- see |
|
| 98 |
- |
|
| 99 |
- [Configuring DNS](#dns) and |
|
| 100 |
- |
|
| 101 |
- [How Docker networks a container](#container-networking) |
|
| 102 |
- |
|
| 103 |
-- `--link=CONTAINER_NAME_or_ID:ALIAS` -- see |
|
| 104 |
- |
|
| 105 |
- [Configuring DNS](#dns) and |
|
| 106 |
- |
|
| 107 |
- [Communication between containers](#between-containers) |
|
| 108 |
- |
|
| 109 |
-- `--net=bridge|none|container:NAME_or_ID|host` -- see |
|
| 110 |
- |
|
| 111 |
- [How Docker networks a container](#container-networking) |
|
| 112 |
- |
|
| 113 |
-- `--mac-address=MACADDRESS...` -- see |
|
| 114 |
- |
|
| 115 |
- [How Docker networks a container](#container-networking) |
|
| 116 |
- |
|
| 117 |
-- `-p SPEC` or `--publish=SPEC` -- see |
|
| 118 |
- |
|
| 119 |
- [Binding container ports](#binding-ports) |
|
| 120 |
- |
|
| 121 |
-- `-P` or `--publish-all=true|false` -- see |
|
| 122 |
- |
|
| 123 |
- [Binding container ports](#binding-ports) |
|
| 124 |
- |
|
| 125 |
-To supply networking options to the Docker server at startup, use the `DOCKER_OPTS` variable in the Docker upstart configuration file. For Ubuntu, edit the variable in `/etc/default/docker` or `/etc/sysconfig/docker` for CentOS. |
|
| 126 |
- |
|
| 127 |
-The following example illustrates how to configure Docker on Ubuntu to recognize a newly built bridge. |
|
| 128 |
- |
|
| 129 |
-Edit the `/etc/default/docker` file: |
|
| 130 |
- |
|
| 131 |
-``` |
|
| 132 |
-$ echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker |
|
| 133 |
-``` |
|
| 134 |
- |
|
| 135 |
-Then restart the Docker server. |
|
| 136 |
- |
|
| 137 |
-``` |
|
| 138 |
-$ sudo service docker start |
|
| 139 |
-``` |
|
| 140 |
- |
|
| 141 |
-For additional information on bridges, see [building your own bridge](#building-your-own-bridge) later on this page. |
| 142 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,28 +0,0 @@ |
| 1 |
-<!--[metadata]> |
|
| 2 |
-+++ |
|
| 3 |
-draft=true |
|
| 4 |
-title = "Saved text" |
|
| 5 |
-keywords = ["docker, bridge, docker0, network"] |
|
| 6 |
-[menu.main] |
|
| 7 |
-parent = "smn_networking_def" |
|
| 8 |
-+++ |
|
| 9 |
-<![end-metadata]--> |
|
| 10 |
- |
|
| 11 |
-<!--[metadata]> |
|
| 12 |
-This content was extracted from the original introduction. We may want to add it back in later under another form. Labeled DRAFT for now. Won't be built. |
|
| 13 |
-<![end-metadata]--> |
|
| 14 |
- |
|
| 15 |
- |
|
| 16 |
-## A Brief introduction to networking and docker |
|
| 17 |
-When Docker starts, it creates a virtual interface named `docker0` on the host machine. It randomly chooses an address and subnet from the private range defined by [RFC 1918](http://tools.ietf.org/html/rfc1918) that are not in use on the host machine, and assigns it to `docker0`. Docker made the choice `172.17.42.1/16` when I started it a few minutes ago, for example -- a 16-bit netmask providing 65,534 addresses for the host machine and its containers. The MAC address is generated using the IP address allocated to the container to avoid ARP collisions, using a range from `02:42:ac:11:00:00` to `02:42:ac:11:ff:ff`. |
|
| 18 |
- |
|
| 19 |
-> **Note:** This document discusses advanced networking configuration and options for Docker. In most cases you won't need this information. If you're looking to get started with a simpler explanation of Docker networking and an introduction to the concept of container linking see the [Docker User Guide](dockerlinks.md). |
|
| 20 |
- |
|
| 21 |
-But `docker0` is no ordinary interface. It is a virtual _Ethernet bridge_ that automatically forwards packets between any other network interfaces that are attached to it. This lets containers communicate both with the host machine and with each other. Every time Docker creates a container, it creates a pair of "peer" interfaces that are like opposite ends of a pipe -- a packet sent on one will be received on the other. It gives one of the peers to the container to become its `eth0` interface and keeps the other peer, with a unique name like `vethAQI2QT`, out in the namespace of the host machine. By binding every `veth*` interface to the `docker0` bridge, Docker creates a virtual subnet shared between the host machine and every Docker container. |
|
| 22 |
- |
|
| 23 |
-The remaining sections of this document explain all of the ways that you can use Docker options and -- in advanced cases -- raw Linux networking commands to tweak, supplement, or entirely replace Docker's default networking configuration. |
|
| 24 |
- |
|
| 25 |
-## Editing networking config files |
|
| 26 |
-Starting with Docker v.1.2.0, you can now edit `/etc/hosts`, `/etc/hostname` and `/etc/resolve.conf` in a running container. This is useful if you need to install bind or other services that might override one of those files. |
|
| 27 |
- |
|
| 28 |
-Note, however, that changes to these files will not be saved by `docker commit`, nor will they be saved during `docker run`. That means they won't be saved in the image, nor will they persist when a container is restarted; they will only "stick" in a running container. |
| 29 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,83 +0,0 @@ |
| 1 |
-<!--[metadata]> |
|
| 2 |
-+++ |
|
| 3 |
-draft=true |
|
| 4 |
-title = "Tools and Examples" |
|
| 5 |
-keywords = ["docker, bridge, docker0, network"] |
|
| 6 |
-[menu.main] |
|
| 7 |
-parent = "smn_networking_def" |
|
| 8 |
-+++ |
|
| 9 |
-<![end-metadata]--> |
|
| 10 |
- |
|
| 11 |
-<!--[metadata]> |
|
| 12 |
-Dave Tucker instructed remove this. We may want to add it back in later under another form. Labeled DRAFT for now. Won't be built. |
|
| 13 |
-<![end-metadata]--> |
|
| 14 |
- |
|
| 15 |
-# Tools and examples |
|
| 16 |
-Before diving into the following sections on custom network topologies, you might be interested in glancing at a few external tools or examples of the same kinds of configuration. Here are two: |
|
| 17 |
-- Jérôme Petazzoni has created a `pipework` shell script to help you |
|
| 18 |
- |
|
| 19 |
- connect together containers in arbitrarily complex scenarios: |
|
| 20 |
- |
|
| 21 |
- [https://github.com/jpetazzo/pipework](https://github.com/jpetazzo/pipework) |
|
| 22 |
- |
|
| 23 |
-- Brandon Rhodes has created a whole network topology of Docker |
|
| 24 |
- |
|
| 25 |
- containers for the next edition of Foundations of Python Network |
|
| 26 |
- |
|
| 27 |
- Programming that includes routing, NAT'd firewalls, and servers that |
|
| 28 |
- |
|
| 29 |
- offer HTTP, SMTP, POP, IMAP, Telnet, SSH, and FTP: |
|
| 30 |
- |
|
| 31 |
- [https://github.com/brandon-rhodes/fopnp/tree/m/playground](https://github.com/brandon-rhodes/fopnp/tree/m/playground) |
|
| 32 |
- |
|
| 33 |
-Both tools use networking commands very much like the ones you saw in the previous section, and will see in the following sections. |
|
| 34 |
- |
|
| 35 |
-# Building a point-to-point connection |
|
| 36 |
-<a name="point-to-point"></a> |
|
| 37 |
- |
|
| 38 |
-By default, Docker attaches all containers to the virtual subnet implemented by `docker0`. You can create containers that are each connected to some different virtual subnet by creating your own bridge as shown in [Building your own bridge](#bridge-building), starting each container with `docker run --net=none`, and then attaching the containers to your bridge with the shell commands shown in [How Docker networks a container](#container-networking). |
|
| 39 |
- |
|
| 40 |
-But sometimes you want two particular containers to be able to communicate directly without the added complexity of both being bound to a host-wide Ethernet bridge. |
|
| 41 |
- |
|
| 42 |
-The solution is simple: when you create your pair of peer interfaces, simply throw _both_ of them into containers, and configure them as classic point-to-point links. The two containers will then be able to communicate directly (provided you manage to tell each container the other's IP address, of course). You might adjust the instructions of the previous section to go something like this: |
|
| 43 |
- |
|
| 44 |
-``` |
|
| 45 |
-# Start up two containers in two terminal windows |
|
| 46 |
- |
|
| 47 |
-$ docker run -i -t --rm --net=none base /bin/bash |
|
| 48 |
-root@1f1f4c1f931a:/# |
|
| 49 |
- |
|
| 50 |
-$ docker run -i -t --rm --net=none base /bin/bash |
|
| 51 |
-root@12e343489d2f:/# |
|
| 52 |
- |
|
| 53 |
-# Learn the container process IDs |
|
| 54 |
-# and create their namespace entries |
|
| 55 |
- |
|
| 56 |
-$ docker inspect -f '{{.State.Pid}}' 1f1f4c1f931a
|
|
| 57 |
-2989 |
|
| 58 |
-$ docker inspect -f '{{.State.Pid}}' 12e343489d2f
|
|
| 59 |
-3004 |
|
| 60 |
-$ sudo mkdir -p /var/run/netns |
|
| 61 |
-$ sudo ln -s /proc/2989/ns/net /var/run/netns/2989 |
|
| 62 |
-$ sudo ln -s /proc/3004/ns/net /var/run/netns/3004 |
|
| 63 |
- |
|
| 64 |
-# Create the "peer" interfaces and hand them out |
|
| 65 |
- |
|
| 66 |
-$ sudo ip link add A type veth peer name B |
|
| 67 |
- |
|
| 68 |
-$ sudo ip link set A netns 2989 |
|
| 69 |
-$ sudo ip netns exec 2989 ip addr add 10.1.1.1/32 dev A |
|
| 70 |
-$ sudo ip netns exec 2989 ip link set A up |
|
| 71 |
-$ sudo ip netns exec 2989 ip route add 10.1.1.2/32 dev A |
|
| 72 |
- |
|
| 73 |
-$ sudo ip link set B netns 3004 |
|
| 74 |
-$ sudo ip netns exec 3004 ip addr add 10.1.1.2/32 dev B |
|
| 75 |
-$ sudo ip netns exec 3004 ip link set B up |
|
| 76 |
-$ sudo ip netns exec 3004 ip route add 10.1.1.1/32 dev B |
|
| 77 |
-``` |
|
| 78 |
- |
|
| 79 |
-The two containers should now be able to ping each other and make connections successfully. Point-to-point links like this do not depend on a subnet nor a netmask, but on the bare assertion made by `ip route` that some other single IP address is connected to a particular network interface. |
|
| 80 |
- |
|
| 81 |
-Note that point-to-point links can be safely combined with other kinds of network connectivity -- there is no need to start the containers with `--net=none` if you want point-to-point links to be an addition to the container's normal networking instead of a replacement. |
|
| 82 |
- |
|
| 83 |
-A final permutation of this pattern is to create the point-to-point link between the Docker host and one container, which would allow the host to communicate with that one container on some single IP address and thus communicate "out-of-band" of the bridge that connects the other, more usual containers. But unless you have very specific networking needs that drive you to such a solution, it is probably far preferable to use `--icc=false` to lock down inter-container communication, as we explored earlier. |
| ... | ... |
@@ -421,7 +421,7 @@ Once you have several machines provisioned, you can use Docker Swarm to quickly |
| 421 | 421 |
form them into a swarm which includes a discovery service as well. |
| 422 | 422 |
|
| 423 | 423 |
To create an overlay network, you configure options on the `daemon` on each |
| 424 |
-Docker Engine for use with `overlay` network. There are two options to set: |
|
| 424 |
+Docker Engine for use with `overlay` network. There are three options to set: |
|
| 425 | 425 |
|
| 426 | 426 |
<table> |
| 427 | 427 |
<thead> |
| ... | ... |
@@ -19,6 +19,7 @@ some pre-existing conditions before you can create one. These conditions are: |
| 19 | 19 |
* Access to a key-value store. Docker supports Consul, Etcd, and ZooKeeper (Distributed store) key-value stores. |
| 20 | 20 |
* A cluster of hosts with connectivity to the key-value store. |
| 21 | 21 |
* A properly configured Engine `daemon` on each host in the cluster. |
| 22 |
+* Hosts within the cluster must have unique hostnames because the key-value store uses the hostnames to identify cluster members. |
|
| 22 | 23 |
|
| 23 | 24 |
Though Docker Machine and Docker Swarm are not mandatory to experience Docker |
| 24 | 25 |
multi-host networking, this example uses them to illustrate how they are |
| ... | ... |
@@ -62,7 +62,7 @@ $ docker network inspect simple-network |
| 62 | 62 |
Unlike `bridge` networks, `overlay` networks require some pre-existing conditions |
| 63 | 63 |
before you can create one. These conditions are: |
| 64 | 64 |
|
| 65 |
-* Access to a key-value store. Engine supports Consul Etcd, and ZooKeeper (Distributed store) key-value stores. |
|
| 65 |
+* Access to a key-value store. Engine supports Consul, Etcd, and ZooKeeper (Distributed store) key-value stores. |
|
| 66 | 66 |
* A cluster of hosts with connectivity to the key-value store. |
| 67 | 67 |
* A properly configured Engine `daemon` on each host in the swarm. |
| 68 | 68 |
|
| ... | ... |
@@ -312,6 +312,7 @@ lo Link encap:Local Loopback |
| 312 | 312 |
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 |
| 313 | 313 |
collisions:0 txqueuelen:0 |
| 314 | 314 |
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) |
| 315 |
+``` |
|
| 315 | 316 |
|
| 316 | 317 |
On the `isolated_nw` which was user defined, the Docker embedded DNS server enables name resolution for other containers in the network. Inside of `container2` it is possible to ping `container3` by name. |
| 317 | 318 |
|
| ... | ... |
@@ -376,7 +377,7 @@ You can connect both running and non-running containers to a network. However, |
| 376 | 376 |
|
| 377 | 377 |
### Linking containers in user-defined networks |
| 378 | 378 |
|
| 379 |
-In the above example, container_2 was able to resolve container_3's name automatically |
|
| 379 |
+In the above example, `container2` was able to resolve `container3`'s name automatically |
|
| 380 | 380 |
in the user defined network `isolated_nw`, but the name resolution did not succeed |
| 381 | 381 |
automatically in the default `bridge` network. This is expected in order to maintain |
| 382 | 382 |
backward compatibility with [legacy link](default_network/dockerlinks.md). |
| ... | ... |
@@ -396,7 +397,7 @@ Comparing the above 4 functionalities with the non-default user-defined networks |
| 396 | 396 |
* ability to dynamically attach and detach to multiple networks |
| 397 | 397 |
* supports the `--link` option to provide name alias for the linked container |
| 398 | 398 |
|
| 399 |
-Continuing with the above example, create another container `container_4` in `isolated_nw` |
|
| 399 |
+Continuing with the above example, create another container `container4` in `isolated_nw` |
|
| 400 | 400 |
with `--link` to provide additional name resolution using alias for other containers in |
| 401 | 401 |
the same network. |
| 402 | 402 |
|
| ... | ... |
@@ -405,26 +406,25 @@ $ docker run --net=isolated_nw -itd --name=container4 --link container5:c5 busyb |
| 405 | 405 |
01b5df970834b77a9eadbaff39051f237957bd35c4c56f11193e0594cfd5117c |
| 406 | 406 |
``` |
| 407 | 407 |
|
| 408 |
-With the help of `--link` container4 will be able to reach container5 using the |
|
| 408 |
+With the help of `--link` `container4` will be able to reach `container5` using the |
|
| 409 | 409 |
aliased name `c5` as well. |
| 410 | 410 |
|
| 411 |
-Please note that while creating container4, we linked to a container named `container5` |
|
| 411 |
+Please note that while creating `container4`, we linked to a container named `container5` |
|
| 412 | 412 |
which is not created yet. That is one of the differences in behavior between the |
| 413 |
-`legacy link` in default `bridge` network and the new `link` functionality in user defined |
|
| 414 |
-networks. The `legacy link` is static in nature and it hard-binds the container with the |
|
| 415 |
-alias and it doesnt tolerate linked container restarts. While the new `link` functionality |
|
| 416 |
-in user defined networks are dynamic in nature and supports linked container restarts |
|
| 417 |
-including tolerating ip-address changes on the linked container. |
|
| 418 | 413 |
|
| 419 |
-Now let us launch another container named `container5` linking container4 to c4. |
|
| 414 |
+*legacy link* in default `bridge` network and the new *link* functionality in user defined |
|
| 415 |
+networks. The *legacy link* is static in nature and it hard-binds the container with the |
|
| 416 |
+alias and it doesn't tolerate linked container restarts. While the new *link* functionality |
|
| 417 |
+ |
|
| 418 |
+Now let us launch another container named `container5` linking `container4` to c4. |
|
| 420 | 419 |
|
| 421 | 420 |
```bash |
| 422 | 421 |
$ docker run --net=isolated_nw -itd --name=container5 --link container4:c4 busybox |
| 423 | 422 |
72eccf2208336f31e9e33ba327734125af00d1e1d2657878e2ee8154fbb23c7a |
| 424 | 423 |
``` |
| 425 | 424 |
|
| 426 |
-As expected, container4 will be able to reach container5 by both its container name and |
|
| 427 |
-its alias c5 and container5 will be able to reach container4 by its container name and |
|
| 425 |
+As expected, `container4` will be able to reach `container5` by both its container name and |
|
| 426 |
+its alias c5 and `container5` will be able to reach `container4` by its container name and |
|
| 428 | 427 |
its alias c4. |
| 429 | 428 |
|
| 430 | 429 |
```bash |
| ... | ... |
@@ -491,7 +491,7 @@ $ docker network create -d bridge --subnet 172.26.0.0/24 local_alias |
| 491 | 491 |
76b7dc932e037589e6553f59f76008e5b76fa069638cd39776b890607f567aaa |
| 492 | 492 |
``` |
| 493 | 493 |
|
| 494 |
-let us connect container4 and container5 to the new network `local_alias` |
|
| 494 |
+let us connect `container4` and `container5` to the new network `local_alias` |
|
| 495 | 495 |
|
| 496 | 496 |
``` |
| 497 | 497 |
$ docker network connect --link container5:foo local_alias container4 |
| ... | ... |
@@ -525,7 +525,7 @@ round-trip min/avg/max = 0.070/0.081/0.097 ms |
| 525 | 525 |
``` |
| 526 | 526 |
|
| 527 | 527 |
Note that the ping succeeds for both the aliases but on different networks. |
| 528 |
-Let us conclude this section by disconnecting container5 from the `isolated_nw` |
|
| 528 |
+Let us conclude this section by disconnecting `container5` from the `isolated_nw` |
|
| 529 | 529 |
and observe the results |
| 530 | 530 |
|
| 531 | 531 |
``` |
| ... | ... |
@@ -550,9 +550,9 @@ round-trip min/avg/max = 0.070/0.081/0.097 ms |
| 550 | 550 |
``` |
| 551 | 551 |
|
| 552 | 552 |
In conclusion, the new link functionality in user defined networks provides all the |
| 553 |
-benefits of legacy links while avoiding most of the well-known issues with `legacy links`. |
|
| 553 |
+benefits of legacy links while avoiding most of the well-known issues with *legacy links*. |
|
| 554 | 554 |
|
| 555 |
-One notable missing functionality compared to `legacy links` is the injection of |
|
| 555 |
+One notable missing functionality compared to *legacy links* is the injection of |
|
| 556 | 556 |
environment variables. Though very useful, environment variable injection is static |
| 557 | 557 |
in nature and must be injected when the container is started. One cannot inject |
| 558 | 558 |
environment variables into a running container without significant effort and hence |
| ... | ... |
@@ -561,10 +561,10 @@ disconnect containers to/from a network. |
| 561 | 561 |
|
| 562 | 562 |
### Network-scoped alias |
| 563 | 563 |
|
| 564 |
-While `links` provide private name resolution that is localized within a container, |
|
| 564 |
+While *link*s provide private name resolution that is localized within a container, |
|
| 565 | 565 |
the network-scoped alias provides a way for a container to be discovered by an |
| 566 | 566 |
alternate name by any other container within the scope of a particular network. |
| 567 |
-Unlike the `link` alias, which is defined by the consumer of a service, the |
|
| 567 |
+Unlike the *link* alias, which is defined by the consumer of a service, the |
|
| 568 | 568 |
network-scoped alias is defined by the container that is offering the service |
| 569 | 569 |
to the network. |
| 570 | 570 |
|
| ... | ... |
@@ -788,8 +788,8 @@ There are certain scenarios such as ungraceful docker daemon restarts in multi-h |
| 788 | 788 |
where the daemon is unable to cleanup stale connectivity endpoints. Such stale endpoints |
| 789 | 789 |
may cause an error `container already connected to network` when a new container is |
| 790 | 790 |
connected to that network with the same name as the stale endpoint. In order to cleanup |
| 791 |
-these stale endpoints, first remove the container and force disconnect |
|
| 792 |
-(`docker network disconnect -f`) the endpoint from the network. Once the endpoint is |
|
| 791 |
+these stale endpoints, first remove the container and force disconnect |
|
| 792 |
+(`docker network disconnect -f`) the endpoint from the network. Once the endpoint is |
|
| 793 | 793 |
cleaned up, the container can be connected to the network. |
| 794 | 794 |
|
| 795 | 795 |
``` |
| ... | ... |
@@ -55,7 +55,7 @@ the `<sequence>` is either a letter [a-Z], or the `ctrl-` combined with any of |
| 55 | 55 |
the following: |
| 56 | 56 |
|
| 57 | 57 |
* `a-z` (a single lowercase alpha character ) |
| 58 |
-* `@` (ampersand) |
|
| 58 |
+* `@` (at sign) |
|
| 59 | 59 |
* `[` (left bracket) |
| 60 | 60 |
* `\\` (two backward slashes) |
| 61 | 61 |
* `_` (underscore) |