Fix ordering of port mapping
This commit is contained in:
parent
d4000e07a9
commit
7a1fb3a8d2
2 changed files with 13 additions and 2 deletions
|
|
@ -86,7 +86,7 @@ class Service(object):
|
|||
for port in options['ports']:
|
||||
port = str(port)
|
||||
if ':' in port:
|
||||
internal_port, external_port = port.split(':', 1)
|
||||
external_port, internal_port = port.split(':', 1)
|
||||
port_bindings[int(internal_port)] = int(external_port)
|
||||
else:
|
||||
port_bindings[int(port)] = None
|
||||
|
|
@ -134,7 +134,13 @@ class Service(object):
|
|||
container_options['name'] = self.next_container_name(one_off)
|
||||
|
||||
if 'ports' in container_options:
|
||||
container_options['ports'] = [str(p).split(':')[0] for p in container_options['ports']]
|
||||
ports = []
|
||||
for port in container_options['ports']:
|
||||
port = str(port)
|
||||
if ':' in port:
|
||||
port = port.split(':')[-1]
|
||||
ports.append(port)
|
||||
container_options['ports'] = ports
|
||||
|
||||
if 'volumes' in container_options:
|
||||
container_options['volumes'] = dict((v.split(':')[1], {}) for v in container_options['volumes'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue