Why doesn't curl against Red Hat registry return all the tags of the container image ?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • podman

Issue

  • When running curl against an image to list the tags, it doesn't list all the tags but only lists the oldest 50 tags. So if more than 50 tags are present for an image, the recent ones are left out from displaying.

curl -s https://registry.access.redhat.com/v2/ubi7/ubi-minimal/tags/list | jq -r '.tags[]' | grep -v -- -source | sort

Note: This applies for all the images and ubi7-minimal is provided here just as an example.

P.S: Image pulls are not affected and they can still be pulled using podman pull

Resolution

  • This is considered a limitation since the v2 API listTags() does not support pagination which is being used to list all the tags which is why the curl command is not listing all of the tags while the skopeo list-tags does.

  • An issue REGISTRY-393 has been raised for this to overcome the limitation. Until this is fixed, skopeo can be made use of as a workaround to list all the tags.

$ skopeo list-tags docker://registry.access.redhat.com/ubi7/ubi-minimal | jq -r '.Tags[]'

Root Cause

  • v2 API listTags() does not support pagination which is being used to list all the tags.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments