mirror of https://github.com/docker/docker-py.git
Merge pull request #1015 from aanand/fix-port-binding-doc
Improve port binding docs
This commit is contained in:
commit
3162c7835c
|
@ -38,7 +38,16 @@ container_id = cli.create_container(
|
|||
)
|
||||
```
|
||||
|
||||
If trying to bind several IPs to the same port, you may use the following syntax:
|
||||
To bind multiple host ports to a single container port, use the following syntax:
|
||||
|
||||
```python
|
||||
cli.create_host_config(port_bindings={
|
||||
1111: [1234, 4567]
|
||||
})
|
||||
```
|
||||
|
||||
You can also bind multiple IPs to a single container port:
|
||||
|
||||
```python
|
||||
cli.create_host_config(port_bindings={
|
||||
1111: [
|
||||
|
@ -47,10 +56,3 @@ cli.create_host_config(port_bindings={
|
|||
]
|
||||
})
|
||||
```
|
||||
|
||||
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