def container_exec(binary, container_image, mounts=None):
    '''
    Build the docker CLI to run a command inside a container
    '''
    _mounts = {}
    _mounts['/run/lock/lvm'] = '/run/lock/lvm:z'
    _mounts['/var/run/udev'] = '/var/run/udev:z'
    _mounts['/dev'] = '/dev'
    _mounts['/etc/ceph'] = '/etc/ceph:z'
    _mounts['/run/lvm'] = '/run/lvm'
    _mounts['/var/lib/ceph'] = '/var/lib/ceph:z'
    _mounts['/var/log/ceph'] = '/var/log/ceph:z'
    if mounts is None:
        mounts = _mounts
    else:
        _mounts.update(mounts)

    volumes = sum(
        [['-v', '{}:{}'.format(src_dir, dst_dir)]
            for src_dir, dst_dir in _mounts.items()], [])

    container_binary = os.getenv('CEPH_CONTAINER_BINARY')
    command_exec = [container_binary, 'run',
                    '--rm',
                    '--privileged',
                    '--net=host',
                    '--ipc=host'] + volumes + \
        ['--entrypoint=' + binary, container_image]
    return command_exec

    Build the docker CLI to run a command inside a container
    
library/ceph_volume.py