diff options
Diffstat (limited to 'docs/sources/userguide')
-rw-r--r-- | docs/sources/userguide/dockerimages.md | 175 | ||||
-rw-r--r-- | docs/sources/userguide/dockerlinks.md | 171 | ||||
-rw-r--r-- | docs/sources/userguide/dockervolumes.md | 4 | ||||
-rw-r--r-- | docs/sources/userguide/search.png | bin | 101216 -> 72860 bytes | |||
-rw-r--r-- | docs/sources/userguide/usingdocker.md | 4 |
5 files changed, 243 insertions, 111 deletions
diff --git a/docs/sources/userguide/dockerimages.md b/docs/sources/userguide/dockerimages.md index 26f969abe8..b7e49058e5 100644 --- a/docs/sources/userguide/dockerimages.md +++ b/docs/sources/userguide/dockerimages.md @@ -245,8 +245,7 @@ example now for building our own Sinatra image for our development team. # This is a comment FROM ubuntu:14.04 MAINTAINER Kate Smith <ksmith@example.com> - RUN apt-get -qq update - RUN apt-get -qqy install ruby ruby-dev + RUN apt-get update && apt-get install -y ruby ruby-dev RUN gem install sinatra Let's look at what our `Dockerfile` does. Each instruction prefixes a statement and is capitalized. @@ -272,38 +271,168 @@ Sinatra gem. Now let's take our `Dockerfile` and use the `docker build` command to build an image. $ sudo docker build -t="ouruser/sinatra:v2" . - Uploading context 2.56 kB - Uploading context + Sending build context to Docker daemon 2.048 kB + Sending build context to Docker daemon Step 0 : FROM ubuntu:14.04 - ---> 99ec81b80c55 + ---> e54ca5efa2e9 Step 1 : MAINTAINER Kate Smith <ksmith@example.com> - ---> Running in 7c5664a8a0c1 - ---> 2fa8ca4e2a13 - Removing intermediate container 7c5664a8a0c1 - Step 2 : RUN apt-get -qq update - ---> Running in b07cc3fb4256 - ---> 50d21070ec0c - Removing intermediate container b07cc3fb4256 - Step 3 : RUN apt-get -qqy install ruby ruby-dev - ---> Running in a5b038dd127e + ---> Using cache + ---> 851baf55332b + Step 2 : RUN apt-get update && apt-get install -y ruby ruby-dev + ---> Running in 3a2558904e9b Selecting previously unselected package libasan0:amd64. (Reading database ... 11518 files and directories currently installed.) Preparing to unpack .../libasan0_4.8.2-19ubuntu1_amd64.deb ... - . . . + Unpacking libasan0:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libatomic1:amd64. + Preparing to unpack .../libatomic1_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libatomic1:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libgmp10:amd64. + Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ... + Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... + Selecting previously unselected package libisl10:amd64. + Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ... + Unpacking libisl10:amd64 (0.12.2-1) ... + Selecting previously unselected package libcloog-isl4:amd64. + Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ... + Unpacking libcloog-isl4:amd64 (0.18.2-1) ... + Selecting previously unselected package libgomp1:amd64. + Preparing to unpack .../libgomp1_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libgomp1:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libitm1:amd64. + Preparing to unpack .../libitm1_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libitm1:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libmpfr4:amd64. + Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ... + Unpacking libmpfr4:amd64 (3.1.2-1) ... + Selecting previously unselected package libquadmath0:amd64. + Preparing to unpack .../libquadmath0_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libquadmath0:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libtsan0:amd64. + Preparing to unpack .../libtsan0_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libtsan0:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package libyaml-0-2:amd64. + Preparing to unpack .../libyaml-0-2_0.1.4-3ubuntu3_amd64.deb ... + Unpacking libyaml-0-2:amd64 (0.1.4-3ubuntu3) ... + Selecting previously unselected package libmpc3:amd64. + Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ... + Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ... + Selecting previously unselected package openssl. + Preparing to unpack .../openssl_1.0.1f-1ubuntu2.4_amd64.deb ... + Unpacking openssl (1.0.1f-1ubuntu2.4) ... + Selecting previously unselected package ca-certificates. + Preparing to unpack .../ca-certificates_20130906ubuntu2_all.deb ... + Unpacking ca-certificates (20130906ubuntu2) ... + Selecting previously unselected package manpages. + Preparing to unpack .../manpages_3.54-1ubuntu1_all.deb ... + Unpacking manpages (3.54-1ubuntu1) ... + Selecting previously unselected package binutils. + Preparing to unpack .../binutils_2.24-5ubuntu3_amd64.deb ... + Unpacking binutils (2.24-5ubuntu3) ... + Selecting previously unselected package cpp-4.8. + Preparing to unpack .../cpp-4.8_4.8.2-19ubuntu1_amd64.deb ... + Unpacking cpp-4.8 (4.8.2-19ubuntu1) ... + Selecting previously unselected package cpp. + Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ... + Unpacking cpp (4:4.8.2-1ubuntu6) ... + Selecting previously unselected package libgcc-4.8-dev:amd64. + Preparing to unpack .../libgcc-4.8-dev_4.8.2-19ubuntu1_amd64.deb ... + Unpacking libgcc-4.8-dev:amd64 (4.8.2-19ubuntu1) ... + Selecting previously unselected package gcc-4.8. + Preparing to unpack .../gcc-4.8_4.8.2-19ubuntu1_amd64.deb ... + Unpacking gcc-4.8 (4.8.2-19ubuntu1) ... + Selecting previously unselected package gcc. + Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ... + Unpacking gcc (4:4.8.2-1ubuntu6) ... + Selecting previously unselected package libc-dev-bin. + Preparing to unpack .../libc-dev-bin_2.19-0ubuntu6_amd64.deb ... + Unpacking libc-dev-bin (2.19-0ubuntu6) ... + Selecting previously unselected package linux-libc-dev:amd64. + Preparing to unpack .../linux-libc-dev_3.13.0-30.55_amd64.deb ... + Unpacking linux-libc-dev:amd64 (3.13.0-30.55) ... + Selecting previously unselected package libc6-dev:amd64. + Preparing to unpack .../libc6-dev_2.19-0ubuntu6_amd64.deb ... + Unpacking libc6-dev:amd64 (2.19-0ubuntu6) ... + Selecting previously unselected package ruby. + Preparing to unpack .../ruby_1%3a1.9.3.4_all.deb ... + Unpacking ruby (1:1.9.3.4) ... + Selecting previously unselected package ruby1.9.1. + Preparing to unpack .../ruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ... + Unpacking ruby1.9.1 (1.9.3.484-2ubuntu1) ... + Selecting previously unselected package libruby1.9.1. + Preparing to unpack .../libruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ... + Unpacking libruby1.9.1 (1.9.3.484-2ubuntu1) ... + Selecting previously unselected package manpages-dev. + Preparing to unpack .../manpages-dev_3.54-1ubuntu1_all.deb ... + Unpacking manpages-dev (3.54-1ubuntu1) ... + Selecting previously unselected package ruby1.9.1-dev. + Preparing to unpack .../ruby1.9.1-dev_1.9.3.484-2ubuntu1_amd64.deb ... + Unpacking ruby1.9.1-dev (1.9.3.484-2ubuntu1) ... + Selecting previously unselected package ruby-dev. + Preparing to unpack .../ruby-dev_1%3a1.9.3.4_all.deb ... + Unpacking ruby-dev (1:1.9.3.4) ... + Setting up libasan0:amd64 (4.8.2-19ubuntu1) ... + Setting up libatomic1:amd64 (4.8.2-19ubuntu1) ... + Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ... + Setting up libisl10:amd64 (0.12.2-1) ... + Setting up libcloog-isl4:amd64 (0.18.2-1) ... + Setting up libgomp1:amd64 (4.8.2-19ubuntu1) ... + Setting up libitm1:amd64 (4.8.2-19ubuntu1) ... + Setting up libmpfr4:amd64 (3.1.2-1) ... + Setting up libquadmath0:amd64 (4.8.2-19ubuntu1) ... + Setting up libtsan0:amd64 (4.8.2-19ubuntu1) ... + Setting up libyaml-0-2:amd64 (0.1.4-3ubuntu3) ... + Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ... + Setting up openssl (1.0.1f-1ubuntu2.4) ... + Setting up ca-certificates (20130906ubuntu2) ... + debconf: unable to initialize frontend: Dialog + debconf: (TERM is not set, so the dialog frontend is not usable.) + debconf: falling back to frontend: Readline + debconf: unable to initialize frontend: Readline + debconf: (This frontend requires a controlling tty.) + debconf: falling back to frontend: Teletype + Setting up manpages (3.54-1ubuntu1) ... + Setting up binutils (2.24-5ubuntu3) ... + Setting up cpp-4.8 (4.8.2-19ubuntu1) ... + Setting up cpp (4:4.8.2-1ubuntu6) ... + Setting up libgcc-4.8-dev:amd64 (4.8.2-19ubuntu1) ... + Setting up gcc-4.8 (4.8.2-19ubuntu1) ... + Setting up gcc (4:4.8.2-1ubuntu6) ... + Setting up libc-dev-bin (2.19-0ubuntu6) ... + Setting up linux-libc-dev:amd64 (3.13.0-30.55) ... + Setting up libc6-dev:amd64 (2.19-0ubuntu6) ... + Setting up manpages-dev (3.54-1ubuntu1) ... + Setting up libruby1.9.1 (1.9.3.484-2ubuntu1) ... + Setting up ruby1.9.1-dev (1.9.3.484-2ubuntu1) ... + Setting up ruby-dev (1:1.9.3.4) ... Setting up ruby (1:1.9.3.4) ... Setting up ruby1.9.1 (1.9.3.484-2ubuntu1) ... Processing triggers for libc-bin (2.19-0ubuntu6) ... - ---> 2acb20f17878 - Removing intermediate container a5b038dd127e - Step 4 : RUN gem install sinatra - ---> Running in 5e9d0065c1f7 - . . . + Processing triggers for ca-certificates (20130906ubuntu2) ... + Updating certificates in /etc/ssl/certs... 164 added, 0 removed; done. + Running hooks in /etc/ca-certificates/update.d....done. + ---> c55c31703134 + Removing intermediate container 3a2558904e9b + Step 3 : RUN gem install sinatra + ---> Running in 6b81cb6313e5 + unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping + unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping + Successfully installed rack-1.5.2 + Successfully installed tilt-1.4.1 Successfully installed rack-protection-1.5.3 Successfully installed sinatra-1.4.5 4 gems installed - ---> 324104cde6ad - Removing intermediate container 5e9d0065c1f7 - Successfully built 324104cde6ad + Installing ri documentation for rack-1.5.2... + Installing ri documentation for tilt-1.4.1... + Installing ri documentation for rack-protection-1.5.3... + Installing ri documentation for sinatra-1.4.5... + Installing RDoc documentation for rack-1.5.2... + Installing RDoc documentation for tilt-1.4.1... + Installing RDoc documentation for rack-protection-1.5.3... + Installing RDoc documentation for sinatra-1.4.5... + ---> 97feabe5d2ed + Removing intermediate container 6b81cb6313e5 + Successfully built 97feabe5d2ed We've specified our `docker build` command and used the `-t` flag to identify our new image as belonging to the user `ouruser`, the repository name `sinatra` diff --git a/docs/sources/userguide/dockerlinks.md b/docs/sources/userguide/dockerlinks.md index d7a2abff9c..3624bf72c3 100644 --- a/docs/sources/userguide/dockerlinks.md +++ b/docs/sources/userguide/dockerlinks.md @@ -4,48 +4,47 @@ page_keywords: Examples, Usage, user guide, links, linking, docker, documentatio # Linking Containers Together -In [the Using Docker section](/userguide/usingdocker) we touched on -connecting to a service running inside a Docker container via a network -port. This is one of the ways that you can interact with services and -applications running inside Docker containers. In this section we're -going to give you a refresher on connecting to a Docker container via a -network port as well as introduce you to the concepts of container -linking. +In [the Using Docker section](/userguide/usingdocker), you saw how you can +connect to a service running inside a Docker container via a network +port. But a port connection is only one way you can interact with services and +applications running inside Docker containers. In this section, we'll briefly revisit +connecting via a network port and then we'll introduce you to another method of access: +container linking. ## Network port mapping refresher -In [the Using Docker section](/userguide/usingdocker) we created a -container that ran a Python Flask application. +In [the Using Docker section](/userguide/usingdocker), you created a +container that ran a Python Flask application: $ sudo docker run -d -P training/webapp python app.py > **Note:** > Containers have an internal network and an IP address -> (remember we used the `docker inspect` command to show the container's +> (as we saw when we used the `docker inspect` command to show the container's > IP address in the [Using Docker](/userguide/usingdocker/) section). > Docker can have a variety of network configurations. You can see more > information on Docker networking [here](/articles/networking/). -When we created that container we used the `-P` flag to automatically map any -network ports inside that container to a random high port from the range 49000 -to 49900 on our Docker host. When we subsequently ran `docker ps` we saw that -port 5000 was bound to port 49155. +When that container was created, the `-P` flag was used to automatically map any +network ports inside it to a random high port from the range 49000 +to 49900 on our Docker host. Next, when `docker ps` was run, you saw that +port 5000 in the container was bound to port 49155 on the host. $ sudo docker ps nostalgic_morse CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bc533791f3f5 training/webapp:latest python app.py 5 seconds ago Up 2 seconds 0.0.0.0:49155->5000/tcp nostalgic_morse -We also saw how we can bind a container's ports to a specific port using -the `-p` flag. +You also saw how you can bind a container's ports to a specific port using +the `-p` flag: $ sudo docker run -d -p 5000:5000 training/webapp python app.py -And we saw why this isn't such a great idea because it constrains us to +And you saw why this isn't such a great idea because it constrains you to only one container on that specific port. -There are also a few other ways we can configure the `-p` flag. By +There are also a few other ways you can configure the `-p` flag. By default the `-p` flag will bind the specified port to all interfaces on -the host machine. But we can also specify a binding to a specific +the host machine. But you can also specify a binding to a specific interface, for example only to the `localhost`. $ sudo docker run -d -p 127.0.0.1:5000:5000 training/webapp python app.py @@ -53,20 +52,19 @@ interface, for example only to the `localhost`. This would bind port 5000 inside the container to port 5000 on the `localhost` or `127.0.0.1` interface on the host machine. -Or to bind port 5000 of the container to a dynamic port but only on the -`localhost` we could: +Or, to bind port 5000 of the container to a dynamic port but only on the +`localhost`, you could use: $ sudo docker run -d -p 127.0.0.1::5000 training/webapp python app.py -We can also bind UDP ports by adding a trailing `/udp`, for example: +You can also bind UDP ports by adding a trailing `/udp`. For example: $ sudo docker run -d -p 127.0.0.1:5000:5000/udp training/webapp python app.py -We also saw the useful `docker port` shortcut which showed us the -current port bindings, this is also useful for showing us specific port -configurations. For example if we've bound the container port to the -`localhost` on the host machine this will be shown in the `docker port` -output. +You also learned about the useful `docker port` shortcut which showed us the +current port bindings. This is also useful for showing you specific port +configurations. For example, if you've bound the container port to the +`localhost` on the host machine, then the `docker port` output will reflect that. $ docker port nostalgic_morse 5000 127.0.0.1:49155 @@ -78,38 +76,39 @@ output. Network port mappings are not the only way Docker containers can connect to one another. Docker also has a linking system that allows you to link -multiple containers together and share connection information between -them. Docker linking will create a parent child relationship where the -parent container can see selected information about its child. +multiple containers together and send connection information from one to another. +When containers are linked, information about a source container can be sent to a +recipient container. This allows the recipient to see selected data describing +aspects of the source container. ## Container naming -To perform this linking Docker relies on the names of your containers. -We've already seen that each container we create has an automatically -created name, indeed we've become familiar with our old friend +To establish links, Docker relies on the names of your containers. +You've already seen that each container you create has an automatically +created name; indeed you've become familiar with our old friend `nostalgic_morse` during this guide. You can also name containers yourself. This naming provides two useful functions: -1. It's useful to name containers that do specific functions in a way +1. It can be useful to name containers that do specific functions in a way that makes it easier for you to remember them, for example naming a - container with a web application in it `web`. + container containing a web application `web`. 2. It provides Docker with a reference point that allows it to refer to other - containers, for example link container `web` to container `db`. + containers, for example, you can specify to link the container `web` to container `db`. You can name your container by using the `--name` flag, for example: $ sudo docker run -d -P --name web training/webapp python app.py -You can see we've launched a new container and used the `--name` flag to -call the container `web`. We can see the container's name using the +This launches a new container and uses the `--name` flag to +name the container `web`. You can see the container's name using the `docker ps` command. $ sudo docker ps -l CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES aed84ee21bde training/webapp:latest python app.py 12 hours ago Up 2 seconds 0.0.0.0:49154->5000/tcp web -We can also use `docker inspect` to return the container's name. +You can also use `docker inspect` to return the container's name. $ sudo docker inspect -f "{{ .Name }}" aed84ee21bde /web @@ -117,67 +116,70 @@ We can also use `docker inspect` to return the container's name. > **Note:** > Container names have to be unique. That means you can only call > one container `web`. If you want to re-use a container name you must delete -> the old container with the `docker rm` command before you can create a new +> the old container (with `docker rm`) before you can create a new > container with the same name. As an alternative you can use the `--rm` > flag with the `docker run` command. This will delete the container -> immediately after it stops. +> immediately after it is stopped. ## Container Linking -Links allow containers to discover and securely communicate with each -other. To create a link you use the `--link` flag. Let's create a new -container, this one a database. +Links allow containers to discover each other and securely transfer information about one +container to another container. When you set up a link, you create a conduit between a +source container and a recipient container. The recipient can then access select data +about the source. To create a link, you use the `--link` flag. First, create a new +container, this time one containing a database. $ sudo docker run -d --name db training/postgres -Here we've created a new container called `db` using the `training/postgres` +This creates a new container called `db` from the `training/postgres` image, which contains a PostgreSQL database. -We need to delete the `web` container we created previously so we can replace it +Now, you need to delete the `web` container you created previously so you can replace it with a linked one: $ docker rm -f web -Now let's create a new `web` container and link it with our `db` container. +Now, create a new `web` container and link it with your `db` container. $ sudo docker run -d -P --name web --link db:db training/webapp python app.py -This will link the new `web` container with the `db` container we created +This will link the new `web` container with the `db` container you created earlier. The `--link` flag takes the form: --link name:alias Where `name` is the name of the container we're linking to and `alias` is an -alias for the link name. We'll see how that alias gets used shortly. +alias for the link name. You'll see how that alias gets used shortly. -Let's look at our linked containers using `docker ps`. +Next, look at your linked containers using `docker ps`. $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 349169744e49 training/postgres:latest su postgres -c '/usr About a minute ago Up About a minute 5432/tcp db, web/db aed84ee21bde training/webapp:latest python app.py 16 hours ago Up 2 minutes 0.0.0.0:49154->5000/tcp web -We can see our named containers, `db` and `web`, and we can see that the `db` -containers also shows `web/db` in the `NAMES` column. This tells us that the -`web` container is linked to the `db` container in a parent/child relationship. +You can see your named containers, `db` and `web`, and you can see that the `db` +container also shows `web/db` in the `NAMES` column. This tells you that the +`web` container is linked to the `db` container, which allows it to access information +about the `db` container. -So what does linking the containers do? Well we've discovered the link creates -a parent-child relationship between the two containers. The parent container, -here `web`, can access information on the child container `db`. To do this -Docker creates a secure tunnel between the containers without the need to -expose any ports externally on the container. You'll note when we started the -`db` container we did not use either of the `-P` or `-p` flags. As we're -linking the containers we don't need to expose the PostgreSQL database via the -network. +So what does linking the containers actually do? You've learned that a link creates a +source container that can provide information about itself to a recipient container. In +our example, the recipient, `web`, can access information about the source `db`. To do +this, Docker creates a secure tunnel between the containers that doesn't need to +expose any ports externally on the container; you'll note when we started the +`db` container we did not use either the `-P` or `-p` flags. That's a big benefit of +linking: we don't need to expose the source container, here the PostgreSQL database, to +the network. -Docker exposes connectivity information for the parent container inside the -child container in two ways: +Docker exposes connectivity information for the source container to the +recipient container in two ways: * Environment variables, * Updating the `/etc/hosts` file. -Let's look first at the environment variables Docker sets. Let's run the `env` -command to list the container's environment variables. +Docker can set a number of environment variables. You run the `env` +command to list the specified container's environment variables. ``` $ sudo docker run --rm --name web2 --link db:db training/webapp env @@ -196,17 +198,17 @@ command to list the container's environment variables. > container. Similarly, some daemons (such as `sshd`) > will scrub them when spawning shells for connection. -We can see that Docker has created a series of environment variables with -useful information about our `db` container. Each variable is prefixed with -`DB_` which is populated from the `alias` we specified above. If our `alias` -were `db1` the variables would be prefixed with `DB1_`. You can use these +You can see that Docker has created a series of environment variables with +useful information about the source `db` container. Each variable is prefixed with +`DB_`, which is populated from the `alias` you specified above. If the `alias` +were `db1`, the variables would be prefixed with `DB1_`. You can use these environment variables to configure your applications to connect to the database -on the `db` container. The connection will be secure, private and only the +on the `db` container. The connection will be secure and private; only the linked `web` container will be able to talk to the `db` container. -In addition to the environment variables Docker adds a host entry for the -linked parent to the `/etc/hosts` file. Let's look at this file on the `web` -container now. +In addition to the environment variables, Docker adds a host entry for the +source container to the `/etc/hosts` file. Here's an entry for the `web` +container: $ sudo docker run -t -i --rm --link db:db training/webapp /bin/bash root@aed84ee21bde:/opt/webapp# cat /etc/hosts @@ -214,9 +216,9 @@ container now. . . . 172.17.0.5 db -We can see two relevant host entries. The first is an entry for the `web` +You can see two relevant host entries. The first is an entry for the `web` container that uses the Container ID as a host name. The second entry uses the -link alias to reference the IP address of the `db` container. Let's try to ping +link alias to reference the IP address of the `db` container. You can ping that host now via this host name. root@aed84ee21bde:/opt/webapp# apt-get install -yqq inetutils-ping @@ -227,21 +229,22 @@ that host now via this host name. 56 bytes from 172.17.0.5: icmp_seq=2 ttl=64 time=0.256 ms > **Note:** -> We had to install `ping` because our container didn't have it. +> In the example, you'll note you had to install `ping` because it was not included +> in the container initially. -We've used the `ping` command to ping the `db` container using it's host entry -which resolves to `172.17.0.5`. We can make use of this host entry to configure -an application to make use of our `db` container. +Here, you used the `ping` command to ping the `db` container using its host entry, +which resolves to `172.17.0.5`. You can use this host entry to configure an application +to make use of your `db` container. > **Note:** -> You can link multiple child containers to a single parent. For -> example, we could have multiple web containers attached to our `db` -> container. +> You can link multiple recipient containers to a single source. For +> example, you could have multiple (differently named) web containers attached to your +>`db` container. # Next step -Now we know how to link Docker containers together the next step is -learning how to manage data, volumes and mounts inside our containers. +Now that you know how to link Docker containers together, the next step is +learning how to manage data, volumes and mounts inside your containers. Go to [Managing Data in Containers](/userguide/dockervolumes). diff --git a/docs/sources/userguide/dockervolumes.md b/docs/sources/userguide/dockervolumes.md index 42b01ecf8b..97593a1e04 100644 --- a/docs/sources/userguide/dockervolumes.md +++ b/docs/sources/userguide/dockervolumes.md @@ -131,14 +131,14 @@ like so: $ sudo docker run --volumes-from dbdata -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata -Here's we've launched a new container and mounted the volume from the +Here we've launched a new container and mounted the volume from the `dbdata` container. We've then mounted a local host directory as `/backup`. Finally, we've passed a command that uses `tar` to backup the contents of the `dbdata` volume to a `backup.tar` file inside our `/backup` directory. When the command completes and the container stops we'll be left with a backup of our `dbdata` volume. -You could then to restore to the same container, or another that you've made +You could then restore it to the same container, or another that you've made elsewhere. Create a new container. $ sudo docker run -v /dbdata --name dbdata2 ubuntu /bin/bash diff --git a/docs/sources/userguide/search.png b/docs/sources/userguide/search.png Binary files differindex 27370741a7..ded0d0d2d3 100644 --- a/docs/sources/userguide/search.png +++ b/docs/sources/userguide/search.png diff --git a/docs/sources/userguide/usingdocker.md b/docs/sources/userguide/usingdocker.md index a882a79c7d..ea13122fd6 100644 --- a/docs/sources/userguide/usingdocker.md +++ b/docs/sources/userguide/usingdocker.md @@ -156,9 +156,9 @@ In this case Docker has exposed port 5000 (the default Python Flask port) on port 49155. Network port bindings are very configurable in Docker. In our last -example the `-P` flag is a shortcut for `-p 5000` that makes port 5000 +example the `-P` flag is a shortcut for `-p 5000` that maps port 5000 inside the container to a high port (from the range 49000 to 49900) on -the local Docker host. We can also bind Docker container's to specific +the local Docker host. We can also bind Docker containers to specific ports using the `-p` flag, for example: $ sudo docker run -d -p 5000:5000 training/webapp python app.py |