Last active
August 29, 2015 14:23
-
-
Save JurrianFahner/c9e9290b137f2fad9e49 to your computer and use it in GitHub Desktop.
Python inspect on all containers
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 | |
from subprocess import * | |
#get all numeric IDs of active containers | |
allActiveContainers = Popen(["docker", "ps", "-q"], stdout=PIPE).communicate()[0] | |
#run the inspect on all active containers to produce one json file | |
check_call(["docker", "inspect"] + allActiveContainers.strip().split('\n')) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment