Merge pull request #19721 from bboreham/doc-ip-failure

Improve wording about re-assigning IP addresses
Upstream-commit: 7beccdc609667e6ec7517494779bbb2ef61102af
Component: engine
This commit is contained in:
Vincent Demeester
2016-01-27 22:17:06 +01:00
2 changed files with 16 additions and 12 deletions

View File

@ -56,12 +56,14 @@ $ docker network connect --alias db --alias mysql multi-host-network container2
You can pause, restart, and stop containers that are connected to a network.
Paused containers remain connected and can be revealed by a `network inspect`.
When the container is stopped, it does not appear on the network until you restart
it. If specified, the container's IP address(es) will be reapplied (if still available)
when a stopped container rejoins the network. One way to guarantee that the container
will be assigned the same IP addresses when it rejoins the network after a stop
or a disconnect, is to specify the `--ip-range` when creating the network, and choose
the static IP address(es) from outside the range. This will ensure that the IP address
will not be given to other dynamic containers while this container is not on the network.
it.
If specified, the container's IP address(es) is reapplied when a stopped
container is restarted. If the IP address is no longer available, the container
fails to start. One way to guarantee that the IP address is available is
to specify an `--ip-range` when creating the network, and choose the static IP
address(es) from outside that range. This ensures that the IP address is not
given to another container while this container is not on the network.
```bash
$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network