Skip to content

Instantly share code, notes, and snippets.

@ryot4
Last active April 22, 2024 16:38
Show Gist options
  • Save ryot4/0291d027140a95d8a6d273595d8c3232 to your computer and use it in GitHub Desktop.
Save ryot4/0291d027140a95d8a6d273595d8c3232 to your computer and use it in GitHub Desktop.
#!/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