docker_utils.py 文件源码

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

项目:clusterdock 作者: cloudera 项目源码 文件源码
def get_clusterdock_container_id():
    """Returns the container ID of the Docker container running clusterdock.
    """
    with quiet():
        for cgroup in local('cat /proc/self/cgroup', capture=True).stdout.split('\n'):
            if 'docker' in cgroup:
                return cgroup.rsplit('/')[-1]

        # If we get through the loop and never find the cgroup, something has gone very wrong.
        raise ContainerNotFoundException('Could not find container name from /proc/self/cgroup.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号