epcim
3/3/2016 - 3:56 PM

Search docker hub on CLI

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