mirror of https://github.com/docker/cli.git
add linked containers to hosts file
Docker-DCO-1.1-Signed-off-by: Bryan Murphy <bmurphy1976@gmail.com> (github: bmurphy1976) Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes) Tested-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
4e22cf681e
commit
2ff41c5365
|
@ -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].
|
||||
|
|
Loading…
Reference in New Issue