Forked from OndrejP/docker-register-2-list-images.sh
Created
September 25, 2025 11:48
-
-
Save sub314xxl/aeab1e1fd0ee9d89390171064aa7fa22 to your computer and use it in GitHub Desktop.
list all images on Docker Register v2
This file contains hidden or 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 | |
| export Register=https://register.example.com | |
| export cLink="/v2/_catalog?n=10" | |
| export cFile=docker.register.catalog | |
| export tFile=docker.register.tags | |
| export wgetC="wget -O- -q -S " | |
| # Usage with user/password | |
| # export wgetC="wget -O- -q -S --user=ondra --password=heslo " | |
| function listFullCatalog { | |
| while true; do | |
| # If you need user/password , add --user= and --pasword= ; Thanks rmetzger | |
| ${wgetC} "${Register}${cLink}" \ | |
| 2>${cFile} \ | |
| | json_pp -t json | grep -F " " | cut -d\" -f2 | listTags | |
| cLink=`grep Link ${cFile} 2>/dev/null | cut -d\< -f2 | cut -d\> -f1` | |
| if [ ! -n "${cLink}" ] ; then break; fi | |
| done | |
| } | |
| function listTags { | |
| cat - | while read image; do | |
| tLink="/v2/${image}/tags/list?n=10" | |
| while true; do | |
| # If you need user/password , add --user= and --pasword= ; Thanks rmetzger | |
| ${wgetC} "${Register}${tLink}" \ | |
| 2>${tFile} \ | |
| | json_pp -t json | grep -F " " | cut -d\" -f2 | sed "s@^@${image}:@" | |
| tLink=`grep Link ${tFile} 2>/dev/null | cut -d\< -f2 | cut -d\> -f1` | |
| if [ ! -n "${tLink}" ] ; then break; fi | |
| done | |
| done | |
| } | |
| listFullCatalog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment