Allow user to choose the IP address for the container

Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
Alessandro Boch 2016-01-07 16:18:34 -08:00 committed by Tibor Vass
parent fcd2860045
commit 0a3c040a07
3 changed files with 12 additions and 1 deletions

View File

@ -30,11 +30,18 @@ You can also use the `docker run --net=<network-name>` option to start a contain
$ docker run -itd --net=multi-host-network busybox
```
You can specify the IP address you want to be assigned to the container's interface.
```bash
$ docker network connect multi-host-network --ip 10.10.36.122 container2
```
You can pause, restart, and stop containers that are connected to a network.
Paused containers remain connected and a revealed by a `network inspect`. When
the container is stopped, it does not appear on the network until you restart
it. The container's IP address is not guaranteed to remain the same when a
stopped container rejoins the network.
stopped container rejoins the network, unless you specified one when you run
`docker network connect` command.
To verify the container is connected, use the `docker network inspect` command. Use `docker network disconnect` to remove a container from the network.

View File

@ -56,6 +56,8 @@ parent = "smn_cli"
--log-opt=[] Log driver specific options
-m, --memory="" Memory limit
--mac-address="" Container MAC address (e.g. 92:d0:c6:0a:29:33)
--ip="" Container IPv4 address (e.g. 172.30.100.104)
--ip6="" Container IPv6 address (e.g. 2001:db8::33)
--memory-reservation="" Memory soft limit
--memory-swap="" A positive integer equal to memory plus swap. Specify -1 to enable unlimited swap.
--memory-swappiness="" Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100.

View File

@ -275,6 +275,8 @@ of the containers.
'<network-name>|<network-id>': connect to a user-defined network
--add-host="" : Add a line to /etc/hosts (host:IP)
--mac-address="" : Sets the container's Ethernet device's MAC address
--ip="" : Sets the container's Ethernet device's IPv4 address
--ip6="" : Sets the container's Ethernet device's IPv6 address
By default, all containers have networking enabled and they can make any
outgoing connections. The operator can completely disable networking