Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
| ... | ... |
@@ -56,12 +56,14 @@ $ docker network connect --alias db --alias mysql multi-host-network container2 |
| 56 | 56 |
You can pause, restart, and stop containers that are connected to a network. |
| 57 | 57 |
Paused containers remain connected and can be revealed by a `network inspect`. |
| 58 | 58 |
When the container is stopped, it does not appear on the network until you restart |
| 59 |
-it. If specified, the container's IP address(es) will be reapplied (if still available) |
|
| 60 |
-when a stopped container rejoins the network. One way to guarantee that the container |
|
| 61 |
-will be assigned the same IP addresses when it rejoins the network after a stop |
|
| 62 |
-or a disconnect, is to specify the `--ip-range` when creating the network, and choose |
|
| 63 |
-the static IP address(es) from outside the range. This will ensure that the IP address |
|
| 64 |
-will not be given to other dynamic containers while this container is not on the network. |
|
| 59 |
+it. |
|
| 60 |
+ |
|
| 61 |
+If specified, the container's IP address(es) is reapplied when a stopped |
|
| 62 |
+container is restarted. If the IP address is no longer available, the container |
|
| 63 |
+fails to start. One way to guarantee that the IP address is available is |
|
| 64 |
+to specify an `--ip-range` when creating the network, and choose the static IP |
|
| 65 |
+address(es) from outside that range. This ensures that the IP address is not |
|
| 66 |
+given to another container while this container is not on the network. |
|
| 65 | 67 |
|
| 66 | 68 |
```bash |
| 67 | 69 |
$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network |
| ... | ... |
@@ -28,12 +28,14 @@ $ docker run -itd --net=multi-host-network --ip 172.20.88.22 --ip6 2001:db8::882 |
| 28 | 28 |
You can pause, restart, and stop containers that are connected to a network. |
| 29 | 29 |
Paused containers remain connected and can be revealed by a `network inspect`. |
| 30 | 30 |
When the container is stopped, it does not appear on the network until you restart |
| 31 |
-it. If specified, the container's IP address(es) will be reapplied (if still available) |
|
| 32 |
-when a stopped container rejoins the network. One way to guarantee that the container |
|
| 33 |
-will be assigned the same IP addresses when it rejoins the network after a stop |
|
| 34 |
-or a disconnect, is to specify the `--ip-range` when creating the network, and choose |
|
| 35 |
-the static IP address(es) from outside the range. This will ensure that the IP address |
|
| 36 |
-will not be given to other dynamic containers while this container is not on the network. |
|
| 31 |
+it. |
|
| 32 |
+ |
|
| 33 |
+If specified, the container's IP address(es) is reapplied when a stopped |
|
| 34 |
+container is restarted. If the IP address is no longer available, the container |
|
| 35 |
+fails to start. One way to guarantee that the IP address is available is |
|
| 36 |
+to specify an `--ip-range` when creating the network, and choose the static IP |
|
| 37 |
+address(es) from outside that range. This ensures that the IP address is not |
|
| 38 |
+given to another container while this container is not on the network. |
|
| 37 | 39 |
|
| 38 | 40 |
```bash |
| 39 | 41 |
$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network |