Skip to content

Instantly share code, notes, and snippets.

@kvaps
Created May 8, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kvaps/b94c7098637e7278eaf0cf5ffaac7069 to your computer and use it in GitHub Desktop.
Save kvaps/b94c7098637e7278eaf0cf5ffaac7069 to your computer and use it in GitHub Desktop.
List all images in the Gitlab docker registry
GITLAB="https://gitlab.example.org"
TOKEN=""
while read REPOSITORY_ID; do
while read REGISTRY_ID; do
curl -s -H "PRIVATE-TOKEN: $TOKEN" "$GITLAB/api/v4//projects/$REPOSITORY_ID/registry/repositories/$REGISTRY_ID/tags?per_page=1000" | jq -r '.[].location'
done < <(curl -s -H "PRIVATE-TOKEN: $TOKEN" "$GITLAB/api/v4//projects/$REPOSITORY_ID/registry/repositories?per_page=1000" | jq -r '.[].id')
done < <(curl -s -H "PRIVATE-TOKEN: $TOKEN" "$GITLAB/api/v4/projects?per_page=1000" | jq -r '.[].id')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment