Allow user to choose the IP address for the container
Signed-off-by: Alessandro Boch <aboch@docker.com> Upstream-commit: 2bb3fc1bc522059e9be5bd967b6a5c49917f5d0c Component: engine
This commit is contained in:
@ -110,6 +110,8 @@ This section lists each version from latest to oldest. Each listing includes a
|
||||
* `POST /containers/create` now allows you to set a read/write rate limit for a
|
||||
device (in bytes per second or IO per second).
|
||||
* `GET /networks` now supports filtering by `name`, `id` and `type`.
|
||||
* `POST /containers/create` now allows you to set the static IPv4 and/or IPv6 address for the container.
|
||||
* `POST /networks/(id)/connect` now allows you to set the static IPv4 and/or IPv6 address for the container.
|
||||
|
||||
### v1.21 API changes
|
||||
|
||||
|
||||
@ -3031,7 +3031,13 @@ POST /networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"Container":"3613f73ba0e4"
|
||||
"Container":"3613f73ba0e4",
|
||||
"endpoint_config": {
|
||||
"test_nw": {
|
||||
"IPv4Address":"172.24.56.89",
|
||||
"IPv6Address":"2001:db8::5689"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user