Last active
April 22, 2024 16:38
-
-
Save ryot4/0291d027140a95d8a6d273595d8c3232 to your computer and use it in GitHub Desktop.
This file contains 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/sh | |
CURL="curl -s --cacert ${HOME}/.local/etc/pki/ca/ca.crt" | |
REGISTRY='https://docker-registry.svc.internal.readonly.xyz/v2' | |
listImages() | |
{ | |
repo="$1" | |
tags=$(${CURL} "${REGISTRY}/${repo}/tags/list" | jq -r '.tags[]') | |
echo "${repo}:" | |
echo "${tags}" | sed 's/ /\n/' | |
echo | |
} | |
repo="$1" | |
if [ -n "${repo}" ]; then | |
listImages "${repo}" | |
else | |
repos=$(${CURL} "${REGISTRY}/_catalog" | jq -r '.repositories[]') | |
for r in ${repos}; do | |
listImages "${r}" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment