diff --git a/docs/reference/commandline/network_connect.md b/docs/reference/commandline/network_connect.md index ab78bf9d5c..dbecda6ddb 100644 --- a/docs/reference/commandline/network_connect.md +++ b/docs/reference/commandline/network_connect.md @@ -30,11 +30,18 @@ You can also use the `docker run --net=` 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. diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index 3ea6ae5415..78643e56af 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -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. diff --git a/docs/reference/run.md b/docs/reference/run.md index 9288dd21d5..e802f3e177 100644 --- a/docs/reference/run.md +++ b/docs/reference/run.md @@ -275,6 +275,8 @@ of the containers. '|': 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