Skip to content

Commit 3162c78

Browse files
committed
Merge pull request #1015 from aanand/fix-port-binding-doc
Improve port binding docs
2 parents 88b5ed7 + 449e037 commit 3162c78

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/port-bindings.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@ container_id = cli.create_container(
3838
)
3939
```
4040

41-
If trying to bind several IPs to the same port, you may use the following syntax:
41+
To bind multiple host ports to a single container port, use the following syntax:
42+
4243
```python
4344
cli.create_host_config(port_bindings={
44-
1111: [
45-
('192.168.0.100', 1234),
46-
('192.168.0.101', 1234)
47-
]
45+
1111: [1234, 4567]
4846
})
4947
```
5048

51-
Similarly for several container ports bound to a single host port:
49+
You can also bind multiple IPs to a single container port:
50+
5251
```python
5352
cli.create_host_config(port_bindings={
54-
1111: [1234, 4567]
53+
1111: [
54+
('192.168.0.100', 1234),
55+
('192.168.0.101', 1234)
56+
]
5557
})
5658
```

0 commit comments

Comments
 (0)