Created
July 11, 2015 22:21
-
-
Save stanislavb/80b04e5ed09b239a8b1d to your computer and use it in GitHub Desktop.
Get Docker image object
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/env python | |
import argparse | |
from docker import Client | |
import json | |
if __name__ == "__main__": | |
c = Client(base_url='unix://var/run/docker.sock') | |
parser = argparse.ArgumentParser() | |
parser.add_argument('image') | |
args = parser.parse_args() | |
images=c.images(name=args.image) | |
print(json.dumps(images, indent=4, sort_keys=True)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment