Skip to content

Instantly share code, notes, and snippets.

@arturfog
Created May 12, 2018 09:05
Show Gist options
  • Save arturfog/6eebf09febdce4347e1914c125970fe6 to your computer and use it in GitHub Desktop.
Save arturfog/6eebf09febdce4347e1914c125970fe6 to your computer and use it in GitHub Desktop.
Allows to show available tags/version of selected docker image
#!/bin/sh
# Source:https://stackoverflow.com/questions/24481564/how-can-i-find-docker-image-with-specific-tag-in-docker-registry-in-docker-comma
#
# Simple script that will display docker repository tags.
#
# Usage:
# $ docker-show-repo-tags.sh ubuntu centos
for Repo in $* ; do
curl -s -S "https://registry.hub.docker.com/v2/repositories/library/$Repo/tags/" | \
sed -e 's/,/,\n/g' -e 's/\[/\[\n/g' | \
grep '"name"' | \
awk -F\" '{print $4;}' | \
sort -fu | \
sed -e "s/^/${Repo}:/"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment