mirror of https://github.com/docker/docker-py.git
Clarify port bindings documentation for non-TCP port bindings
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
This commit is contained in:
parent
82f4c271ea
commit
af1bb34d98
14
README.md
14
README.md
|
@ -253,12 +253,6 @@ open inside the container in the `Client.create_container` method.
|
||||||
c.create_container('busybox', 'ls', ports=[1111, 2222])
|
c.create_container('busybox', 'ls', ports=[1111, 2222])
|
||||||
```
|
```
|
||||||
|
|
||||||
If you wish to use UDP instead of TCP (default), you can declare it like such:
|
|
||||||
|
|
||||||
```python
|
|
||||||
c.create_container('busybox', 'ls', ports=[(1111, 'udp'), 2222])
|
|
||||||
```
|
|
||||||
|
|
||||||
Bindings are then declared in the `Client.start` method.
|
Bindings are then declared in the `Client.start` method.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -277,6 +271,14 @@ Or without host port assignment:
|
||||||
c.start(container_id, port_bindings={1111: ('127.0.0.1',)})
|
c.start(container_id, port_bindings={1111: ('127.0.0.1',)})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you wish to use UDP instead of TCP (default), you need to declare it
|
||||||
|
like such in both the `create_container()` and `start()` calls:
|
||||||
|
|
||||||
|
```python
|
||||||
|
container_id = c.create_container('busybox', 'ls', ports=[(1111, 'udp'), 2222])
|
||||||
|
c.start(container_id, port_bindings={'1111/udp': 4567, 2222: None})
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Using volumes
|
Using volumes
|
||||||
=============
|
=============
|
||||||
|
|
Loading…
Reference in New Issue