Normally, this would be a bad idea. My use case was this, we had a private registry with all our images going back a while, badly needing to get cleaned up and purged, and I wanted to grab a archive first. We couldn't just ssh to the machine hosting the registry to back it up that way.
To pull an image we need to know the registry, repository, and tag.
Luckily getting a list of repositories in the registry is easy with curl
and jq
.
curl --user "$REG_USER:$REG_PASS" -H "Accept: application/json" "https://$REGISTRY/v2/_catalog" | jq -r '.repositories[]'