commit
8afb4691a5
1 changed files with 5 additions and 13 deletions
|
@ -84,7 +84,7 @@ class ACIImage(TarImageFormatter):
|
||||||
""" Builds the ports definitions for the ACI. """
|
""" Builds the ports definitions for the ACI. """
|
||||||
ports = []
|
ports = []
|
||||||
|
|
||||||
for docker_port_definition in docker_config.get('ports', {}):
|
for docker_port_definition in docker_config.get('ports', docker_config.get('Ports', {})):
|
||||||
# Formats:
|
# Formats:
|
||||||
# port/tcp
|
# port/tcp
|
||||||
# port/udp
|
# port/udp
|
||||||
|
@ -117,20 +117,12 @@ class ACIImage(TarImageFormatter):
|
||||||
names = set()
|
names = set()
|
||||||
|
|
||||||
def get_name(docker_volume_path):
|
def get_name(docker_volume_path):
|
||||||
parts = docker_volume_path.split('/')
|
return "volume-%s" % docker_volume_path.replace('/', '-')
|
||||||
name = ''
|
|
||||||
|
|
||||||
while True:
|
for docker_volume_path in docker_config.get('volumes', docker_config.get('Volumes', {})):
|
||||||
name = name + parts[-1]
|
if not docker_volume_path:
|
||||||
parts = parts[0:-1]
|
continue
|
||||||
if names.add(name):
|
|
||||||
break
|
|
||||||
|
|
||||||
name = '/' + name
|
|
||||||
|
|
||||||
return name.lower()
|
|
||||||
|
|
||||||
for docker_volume_path in docker_config.get('volumes', {}):
|
|
||||||
volumes.append({
|
volumes.append({
|
||||||
"name": get_name(docker_volume_path),
|
"name": get_name(docker_volume_path),
|
||||||
"path": docker_volume_path,
|
"path": docker_volume_path,
|
||||||
|
|
Reference in a new issue