1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #8682 from wpp/update_linking_documentation

Update linking documentation
This commit is contained in:
Sven Dowideit 2014-10-21 21:01:51 -07:00
commit 6aeda16995

View file

@ -151,18 +151,13 @@ earlier. The `--link` flag takes the form:
Where `name` is the name of the container we're linking to and `alias` is an Where `name` is the name of the container we're linking to and `alias` is an
alias for the link name. You'll see how that alias gets used shortly. alias for the link name. You'll see how that alias gets used shortly.
Next, look at the names of your linked containers by filtering the full output of Next, inspect your linked containers with `docker inspect`:
`docker ps` to the last column (NAMES) using `docker ps --no-trunc | awk '{print $NF}'`.
$ sudo docker ps --no-trunc | awk '{print $NF}' $ sudo docker inspect -f "{{ .HostConfig.Links }}" web
NAMES [/db:/web/db]
db, web/db
web
You can see your named containers, `db` and `web`, and you can see that the `db` You can see that the `web` container is now linked to the `db` container
container also shows `web/db` in the `NAMES` column. This tells you that the `web/db`. Which allows it to access information about the `db` container.
`web` container is linked to the `db` container, which allows it to access information
about the `db` container.
So what does linking the containers actually do? You've learned that a link creates a 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 source container that can provide information about itself to a recipient container. In