Add missing documentation for static IP options

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: d3aa590eec
Component: cli
This commit is contained in:
Alessandro Boch
2016-01-11 18:03:40 -08:00
committed by Tibor Vass
parent 4e0c23bead
commit 0570aaed74
7 changed files with 70 additions and 14 deletions

View File

@ -35,6 +35,8 @@ docker-create - Create a new container
[**-h**|**--hostname**[=*HOSTNAME*]]
[**--help**]
[**-i**|**--interactive**]
[**--ip**[=*IPv4-ADDRESS*]]
[**--ip6**[=*IPv6-ADDRESS*]]
[**--ipc**[=*IPC*]]
[**--isolation**[=*default*]]
[**--kernel-memory**[=*KERNEL-MEMORY*]]
@ -174,6 +176,16 @@ two memory nodes.
**-i**, **--interactive**=*true*|*false*
Keep STDIN open even if not attached. The default is *false*.
**--ip**=""
Sets the container's interface IPv4 address (e.g. 172.23.0.9)
It can only be used in conjunction with **--net** for user-defined networks
**--ip6**=""
Sets the container's interface IPv6 address (e.g. 2001:db8::1b99)
It can only be used in conjunction with **--net** for user-defined networks
**--ipc**=""
Default is to create a private IPC namespace (POSIX SysV IPC) for the container
'container:<name|id>': reuses another container shared memory, semaphores and message queues

View File

@ -22,14 +22,26 @@ $ docker network connect multi-host-network container1
You can also use the `docker run --net=<network-name>` option to start a container and immediately connect it to a network.
```bash
$ docker run -itd --net=multi-host-network busybox
$ docker run -itd --net=multi-host-network --ip 172.20.88.22 --ip6 2001:db8::8822 busybox
```
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.
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.
```bash
$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network
```
```bash
$ docker network connect --ip 172.20.128.2 multi-host-network container2
```
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

@ -37,6 +37,8 @@ docker-run - Run a command in a new container
[**-h**|**--hostname**[=*HOSTNAME*]]
[**--help**]
[**-i**|**--interactive**]
[**--ip**[=*IPv4-ADDRESS*]]
[**--ip6**[=*IPv6-ADDRESS*]]
[**--ipc**[=*IPC*]]
[**--isolation**[=*default*]]
[**--kernel-memory**[=*KERNEL-MEMORY*]]
@ -274,6 +276,16 @@ redirection on the host system.
When set to true, keep stdin open even if not attached. The default is false.
**--ip**=""
Sets the container's interface IPv4 address (e.g. 172.23.0.9)
It can only be used in conjunction with **--net** for user-defined networks
**--ip6**=""
Sets the container's interface IPv6 address (e.g. 2001:db8::1b99)
It can only be used in conjunction with **--net** for user-defined networks
**--ipc**=""
Default is to create a private IPC namespace (POSIX SysV IPC) for the container
'container:<name|id>': reuses another container shared memory, semaphores and message queues