diff options
author | Joffrey F <f.joffrey@gmail.com> | 2016-03-30 11:39:33 -0700 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2016-03-30 11:39:33 -0700 |
commit | 3162c7835c08282e40b8968ba47704943094c783 (patch) | |
tree | 3cbcc96f4dd412340c3140bbeffa517268f7479b | |
parent | 88b5ed781cbedd1584d6cc6015b18943fd752212 (diff) | |
parent | 449e037de3509fcfdd4218f1e31ccc2c0066e231 (diff) | |
download | docker-py-3162c7835c08282e40b8968ba47704943094c783.tar.gz |
Merge pull request #1015 from aanand/fix-port-binding-doc
Improve port binding docs
-rw-r--r-- | docs/port-bindings.md | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/port-bindings.md b/docs/port-bindings.md index a9b973f..d31760c 100644 --- a/docs/port-bindings.md +++ b/docs/port-bindings.md @@ -38,19 +38,21 @@ 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: [ - ('192.168.0.100', 1234), - ('192.168.0.101', 1234) - ] + 1111: [1234, 4567] }) ``` -Similarly for several container ports bound to a single host port: +You can also bind multiple IPs to a single container port: + ```python cli.create_host_config(port_bindings={ - 1111: [1234, 4567] + 1111: [ + ('192.168.0.100', 1234), + ('192.168.0.101', 1234) + ] }) ``` |