mirror of https://github.com/docker/docker-py.git
Support sctp as protocol
Signed-off-by: Hannes Ljungberg <hannes@5monkeys.se>
This commit is contained in:
parent
e0024b5b3f
commit
5d76e8e13e
|
@ -915,9 +915,10 @@ class ContainerApiMixin(object):
|
||||||
if '/' in private_port:
|
if '/' in private_port:
|
||||||
return port_settings.get(private_port)
|
return port_settings.get(private_port)
|
||||||
|
|
||||||
h_ports = port_settings.get(private_port + '/tcp')
|
for protocol in ['tcp', 'udp', 'sctp']:
|
||||||
if h_ports is None:
|
h_ports = port_settings.get(private_port + '/' + protocol)
|
||||||
h_ports = port_settings.get(private_port + '/udp')
|
if h_ports:
|
||||||
|
break
|
||||||
|
|
||||||
return h_ports
|
return h_ports
|
||||||
|
|
||||||
|
|
|
@ -649,8 +649,8 @@ class ContainerCollection(Collection):
|
||||||
|
|
||||||
The keys of the dictionary are the ports to bind inside the
|
The keys of the dictionary are the ports to bind inside the
|
||||||
container, either as an integer or a string in the form
|
container, either as an integer or a string in the form
|
||||||
``port/protocol``, where the protocol is either ``tcp`` or
|
``port/protocol``, where the protocol is either ``tcp``,
|
||||||
``udp``.
|
``udp``, or ``sctp``.
|
||||||
|
|
||||||
The values of the dictionary are the corresponding ports to
|
The values of the dictionary are the corresponding ports to
|
||||||
open on the host, which can be either:
|
open on the host, which can be either:
|
||||||
|
|
|
@ -7,7 +7,7 @@ PORT_SPEC = re.compile(
|
||||||
r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range
|
r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range
|
||||||
")?"
|
")?"
|
||||||
r"(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range
|
r"(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range
|
||||||
"(?P<proto>/(udp|tcp))?" # Protocol
|
"(?P<proto>/(udp|tcp|sctp))?" # Protocol
|
||||||
"$" # Match full string
|
"$" # Match full string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue