Skip to content

Instantly share code, notes, and snippets.

@JurrianFahner
Last active August 29, 2015 14:23
Show Gist options
  • Save JurrianFahner/c9e9290b137f2fad9e49 to your computer and use it in GitHub Desktop.
Save JurrianFahner/c9e9290b137f2fad9e49 to your computer and use it in GitHub Desktop.
Python inspect on all containers
#!/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