Merge pull request #1015 from aanand/fix-port-binding-doc

Improve port binding docs
This commit is contained in:
Joffrey F 2016-03-30 11:39:33 -07:00
commit 3162c7835c
1 changed files with 10 additions and 8 deletions

View File

@ -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]
})
```