I got an answer from here . Thank you very much! :)
Just a single line script: (find all Debian tags)
wget -q https://registry.hub.docker.com/v1/repositories/debian/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'
UPDATE Thanks for the advice @degelf. Here is a shell script.
#!/bin/bash if [ $# -lt 1 ] then cat << HELP dockertags -- list all tags for a Docker image on a remote registry. EXAMPLE: - list all tags for ubuntu: dockertags ubuntu - list all php tags containing apache: dockertags php apache HELP fi image="$1" tags='wget -q https://registry.hub.docker.com/v1/repositories/${image}/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}'' if [ -n "$2" ] then tags=' echo "${tags}" | grep "$2" ' fi echo "${tags}"
You can simply create a new file name, dockertags , in / usr / local / bin (or add PATH env to your .bashrc / .zshrc ) and put this code in it. Then add permissions to the executable ( chmod +x dockertags ).
Using:
dockertags ubuntu ---> list all ubuntu tags
dockertags php apache ---> list all php php tags containing 'apache'
Vi.Ci Sep 12 '16 at 16:00 2016-09-12 16:00
source share