diff --git a/formats/aci.py b/formats/aci.py index d23e0c3f1..a34f91631 100644 --- a/formats/aci.py +++ b/formats/aci.py @@ -79,12 +79,28 @@ class ACIImage(TarImageFormatter): return isolators + + @staticmethod + def _get_docker_config_value(docker_config, key, default_value): + # Try the key itself. + result = docker_config.get(key) + if result is not None: + return result or default_value + + # The the lowercase version of the key. + result = docker_config.get(key.lower()) + if result is not None: + return result or default_value + + return default_value + + @staticmethod def _build_ports(docker_config): """ Builds the ports definitions for the ACI. """ ports = [] - for docker_port_definition in docker_config.get('ports', docker_config.get('Ports', {})): + for docker_port_definition in ACIImage._get_docker_config_value(docker_config, 'Ports', []): # Formats: # port/tcp # port/udp @@ -119,7 +135,7 @@ class ACIImage(TarImageFormatter): def get_name(docker_volume_path): return "volume-%s" % docker_volume_path.replace('/', '-') - for docker_volume_path in docker_config.get('volumes', docker_config.get('Volumes', {})): + for docker_volume_path in ACIImage._get_docker_config_value(docker_config, 'Volumes', []): if not docker_volume_path: continue