Skip to content

Commit a8e03d3

Browse files
committed
Fixed port bindings conversion to support legacy port bindings. Fixes #135
1 parent 28cb2c5 commit a8e03d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docker/utils/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ def _convert_port_binding(binding):
9292
result['HostIp'] = binding[0]
9393
else:
9494
result['HostPort'] = binding[0]
95+
elif isinstance(binding, dict):
96+
if 'HostPort' in binding:
97+
result['HostPort'] = binding['HostPort']
98+
if 'HostIp' in binding:
99+
result['HostIp'] = binding['HostIp']
100+
else:
101+
raise ValueError(binding)
95102
else:
96103
result['HostPort'] = binding
97104

0 commit comments

Comments
 (0)