Browse code

Update container linking documentation

As of 1.3 `docker ps` no longer shows links between containers.
This updates the documentation to reflect that change.

sudo docker docker inspect -f "{{ .HostConfig.Links }}" web

Signed-off-by: Philipp Weissensteiner <mail@philippweissensteiner.com>

Philipp Weissensteiner authored on 2014/10/22 03:17:20
Showing 1 changed files
... ...
@@ -151,18 +151,13 @@ earlier. The `--link` flag takes the form:
151 151
 Where `name` is the name of the container we're linking to and `alias` is an
152 152
 alias for the link name. You'll see how that alias gets used shortly.
153 153
 
154
-Next, look at the names of your linked containers by filtering the full output of
155
-`docker ps` to the last column (NAMES) using `docker ps --no-trunc | awk '{print $NF}'`.
156
-
157
-    $ sudo docker ps --no-trunc | awk '{print $NF}'
158
-    NAMES
159
-    db, web/db
160
-    web
161
-
162
-You can see your named containers, `db` and `web`, and you can see that the `db`
163
-container also shows `web/db` in the `NAMES` column. This tells you that the
164
-`web` container is linked to the `db` container, which allows it to access information
165
-about the `db` container.
154
+Next, inspect your linked containers with `docker inspect`:
155
+
156
+    $ sudo docker inspect -f "{{ .HostConfig.Links }}" web
157
+    [/db:/web/db]
158
+
159
+You can see that the `web` container is now linked to the `db` container
160
+`web/db`. Which allows it to access information about the `db` container.
166 161
 
167 162
 So what does linking the containers actually do? You've learned that a link creates a
168 163
 source container that can provide information about itself to a recipient container. In