-
-
Save lgs/11246177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# e.g. docker ps -a | grep 'my name' | awk '{print $1}' | xargs docker inspect | ./volume-list.py | |
import json | |
import fileinput | |
raw = [] | |
for line in fileinput.input(): | |
raw.append(line) | |
data = json.loads(''.join(raw)) | |
volumes = [(k, v) for i in data for (k, v) in i['Volumes'].items()] | |
for v in volumes: | |
print '%s,%s' % (v[0], v[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment