Docs update for link functionality in user-defined networks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2016-01-11 02:34:17 -08:00 committed by Tibor Vass
parent 442cbbfac1
commit bf03439e68
2 changed files with 17 additions and 7 deletions

View File

@ -15,6 +15,9 @@ parent = "smn_cli"
Connects a container to a network Connects a container to a network
--help Print usage --help Print usage
--ip IP Address
--ip6 IPv6 Address
--link=[] Add a link to another container
Connects a container to a network. You can connect a container by name Connects a container to a network. You can connect a container by name
or by ID. Once connected, the container can communicate with other containers in or by ID. Once connected, the container can communicate with other containers in
@ -33,7 +36,13 @@ $ docker run -itd --net=multi-host-network busybox
You can specify the IP address you want to be assigned to the container's interface. You can specify the IP address you want to be assigned to the container's interface.
```bash ```bash
$ docker network connect multi-host-network --ip 10.10.36.122 container2 $ docker network connect --ip 10.10.36.122 multi-host-network container2
```
You can use `--link` option to link another container with a prefered alias
```bash
$ docker network connect --link container1:c1 multi-host-network container2
``` ```
You can pause, restart, and stop containers that are connected to a network. You can pause, restart, and stop containers that are connected to a network.
@ -60,3 +69,4 @@ You can connect a container to one or more networks. The networks need not be th
* [network ls](network_ls.md) * [network ls](network_ls.md)
* [network rm](network_rm.md) * [network rm](network_rm.md)
* [Understand Docker container networks](../../userguide/networking/dockernetworks.md) * [Understand Docker container networks](../../userguide/networking/dockernetworks.md)
* [Work with networks](../../userguide/networking/work-with-networks.md)

View File

@ -1301,12 +1301,12 @@ specifies `EXPOSE 80` in the Dockerfile). At runtime, the port might be
bound to 42800 on the host. To find the mapping between the host ports bound to 42800 on the host. To find the mapping between the host ports
and the exposed ports, use `docker port`. and the exposed ports, use `docker port`.
If the operator uses `--link` when starting a new client container, then the If the operator uses `--link` when starting a new client container in the
client container can access the exposed port via a private networking interface. default bridge network, then the client container can access the exposed
Linking is a legacy feature that is only supported on the default bridge port via a private networking interface.
network. You should prefer the Docker networks feature instead. For more If `--link` is used when starting a container in a user-defined network as
information on this feature, see the [*Docker network described in [*Docker network overview*""](../userguide/networking/index.md)),
overview*""](../userguide/networking/index.md)). it will provide a named alias for the container being linked to.
### ENV (environment variables) ### ENV (environment variables)