mirror of https://github.com/docker/docker-py.git
Advanced documentation for port bindings
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
446e6d08dd
commit
41d049a11c
|
@ -37,3 +37,20 @@ container_id = cli.create_container(
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If trying to bind several IPs to the same port, you may use the following syntax:
|
||||||
|
```python
|
||||||
|
cli.create_host_config(port_bindings={
|
||||||
|
1111: [
|
||||||
|
('192.168.0.100', 1234),
|
||||||
|
('192.168.0.101', 1234)
|
||||||
|
]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
Similarly for several container ports bound to a single host port:
|
||||||
|
```python
|
||||||
|
cli.create_host_config(port_bindings={
|
||||||
|
1111: [1234, 4567]
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue