'Print the public port for a port binding.
Usage: port [options] SERVICE PRIVATE_PORT
Options:
--protocol=proto  tcp or udp [default: tcp]
--index=index     index of the container if there are multiple
instances of a service [default: 1]'

def port(self, options):

    index = int(options.get(u'--index'))
    service = self.project.get_service(options[u'SERVICE'])
    try:
        container = service.get_container(number=index)
    except ValueError as e:
        raise UserError(str(e))
    print((container.get_local_port(options[u'PRIVATE_PORT'], protocol=(options.get(u'--protocol') or u'tcp')) or u''))
