Created
March 3, 2016 15:56
-
-
Save epcim/e3f5c891c35d8d399d61 to your computer and use it in GitHub Desktop.
Search docker hub on CLI
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
#!/bin/bash | |
# http://stackoverflow.com/questions/24481564/how-can-i-find-docker-image-with-specific-tag-in-docker-registry-in-docker-comma | |
for Repo in $* ; do | |
tags=$(curl -s -S "https://registry.hub.docker.com/v2/repositories/library/$Repo/tags/") | |
python - <<EOF | |
import json | |
tags = [t['name'] for t in json.loads('''$tags''')['results']] | |
tags.sort() | |
for tag in tags: | |
print "{}:{}".format('$Repo', tag) | |
EOF | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment