Skip to content

Instantly share code, notes, and snippets.

@epcim
Created March 3, 2016 15:56
Show Gist options
  • Save epcim/e3f5c891c35d8d399d61 to your computer and use it in GitHub Desktop.
Save epcim/e3f5c891c35d8d399d61 to your computer and use it in GitHub Desktop.
Search docker hub on CLI
#!/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