Skip to content

Commit 41d049a

Browse files
committed
Advanced documentation for port bindings
Signed-off-by: Joffrey F <[email protected]>
1 parent 446e6d0 commit 41d049a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/port-bindings.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,20 @@ container_id = cli.create_container(
3737
})
3838
)
3939
```
40+
41+
If trying to bind several IPs to the same port, you may use the following syntax:
42+
```python
43+
cli.create_host_config(port_bindings={
44+
1111: [
45+
('192.168.0.100', 1234),
46+
('192.168.0.101', 1234)
47+
]
48+
})
49+
```
50+
51+
Similarly for several container ports bound to a single host port:
52+
```python
53+
cli.create_host_config(port_bindings={
54+
1111: [1234, 4567]
55+
})
56+
```

0 commit comments

Comments
 (0)