':type inspect_data: dict
:param inspect_data: output of docker inspect
:returns: a list of triples containing (internal_port, external_ip,
external_port), of which the ports are probably the only
useful information.
Someday code that calls this should be refactored whenever we get
containers with multiple ports working.'

def get_container_port_mapping(self, inspect_data):

    mappings = []
    port_mappings = inspect_data[0]['NetworkSettings']['Ports']
    for port_name in port_mappings:
        for binding in port_mappings[port_name]:
            mappings.append((int(port_name.replace('/tcp', '').replace('/udp', '')), binding['HostIp'], int(binding['HostPort'])))
    return mappings
