add linked containers to hosts file
Docker-DCO-1.1-Signed-off-by: Bryan Murphy (github: bmurphy1976)
Docker-DCO-1.1-Signed-off-by: Solomon Hykes (github: shykes)
Tested-by: Solomon Hykes (github: shykes)
@@ -407,6 +407,13 @@ And we can use that information to connect from another container as a client:
$ docker run -i -t --rm --link redis-name:redis_alias --entrypoint /bin/bash dockerfiles/redis -c '/redis-stable/src/redis-cli -h $REDIS_ALIAS_PORT_6379_TCP_ADDR -p $REDIS_ALIAS_PORT_6379_TCP_PORT'
172.17.0.32:6379>
+Docker will also map the private IP address to the alias of a linked
+container by inserting an entry into `/etc/hosts`. You can use this
+mechanism to communicate with a linked container by its alias:
+
+ $ docker run -d --name servicename busybox sleep 30
+ $ docker run -i -t --link servicename:servicealias busybox ping -c 1 servicealias
+
## VOLUME (Shared Filesystems)
-v=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro].
