docker_machine.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:TigerHost 作者: naphatkrit 项目源码 文件源码
def get_url(machine_name):
    """Given a docker machine, retrieve the URL for this machine.
    This is the DOCKER_HOST env variable from running
    `docker-machine env {name}`

    :param str machine_name: the name of the docker machine

    :rtype: str
    :returns: machine URL
    """
    dir_path = _machine_path(machine_name)
    if not os.path.exists(dir_path):
        raise MachineNotFoundError

    env_text = check_output(
        ['env', machine_name])
    env = parse_shell_for_exports(env_text)
    return env['DOCKER_HOST']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号