In [1]:
from docker import Client

In [2]:
cli = Client(base_url='unix://var/run/docker.sock')

In [12]:
for container in cli.containers():
    id = container['Id']
    print(cli.inspect_container(id)['Mounts'])


[{'Destination': '/data/frontend/felask/static/bower', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/libs/bower_components', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data', 'RW': True, 'Source': '/Users/projects/restapi/restfixing', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/felask/templates/custom', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/templates/python', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/felask/static/img/custom', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/img', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/config/angular/blueprints', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/specs', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/felask/static/app', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/jscode', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/felask/static/css', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/templates/customcss', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/data/frontend/felask/pypages', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/pages', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'RW': True, 'Driver': 'local', 'Source': '/var/lib/docker/volumes/restangulask_apilitedb/_data', 'Mode': 'rw', 'Destination': '/dbs', 'Name': 'restangulask_apilitedb', 'Propagation': 'rprivate'}]
[{'Destination': '/code', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/backend', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/code/confs/endpoints', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/specs', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'Destination': '/code/restapi/resources/custom', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/apis', 'Propagation': 'rprivate', 'Mode': 'rw'}, {'RW': True, 'Driver': 'local', 'Source': '/var/lib/docker/volumes/restangulask_apilitedb/_data', 'Mode': 'rw', 'Destination': '/dbs', 'Name': 'restangulask_apilitedb', 'Propagation': 'rprivate'}, {'Destination': '/code/libs', 'RW': True, 'Source': '/Users/projects/restapi/restfixing/vanilla/libs', 'Propagation': 'rprivate', 'Mode': 'rw'}]

In [4]:
cli.inspect_container?