def get_docker_container_rootfs_path(long_id, inspect=None):
    driver = get_docker_storage_driver()

    if driver == 'devicemapper':

        if not inspect:
            inspect = exec_dockerinspect(long_id)

        pid = inspect['State']['Pid']

        # XXX this looks ugly and brittle
        proc = subprocess.Popen(
            'awk \'{if ($2 == "/" && $1 != "rootfs") print $1}\' /proc/' +
            pid +
            "/mounts | xargs grep /proc/mounts -e | awk '{print $2}'",
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        rootfs_path = proc.stdout.read().strip() + '/rootfs'

    elif driver == 'btrfs':

        # XXX this looks ugly and brittle
        proc = subprocess.Popen(
            'btrfs subvolume list /var/lib/docker | ' +
            'grep ' +
            long_id +
            " | awk '{print $NF}' | grep -v 'init' |  head -n 1",
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        btrfs_path = proc.stdout.read().strip()
        rootfs_path = '/var/lib/docker/' + btrfs_path

    elif driver == 'aufs':
       # print "long_id: ", long_id
       # XXX this looks ugly and brittle       
        proc = subprocess.Popen(
            'find /var/lib/docker -name "' + long_id + '*" | ' +
            'grep mnt | ' +
            " grep -v 'init' |  head -n 1",
            shell=True,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE)
        aufs_path = proc.stdout.read().strip()
        # print "===> aufs_path: ", aufs_path
        rootfs_path = aufs_path
 

    else:

        raise RuntimeError('Not supported docker storage driver.')

    return rootfs_path
Returns the path to a container root (with ID=long_id) in the docker host
dataset/ETHPy150Open cloudviz/agentless-system-crawler/crawler/dockerutils.py/get_docker_container_rootfs_path