Skip to content

Add single tag details API endpoint

Create a new "single tag details" API on the registry side. We can then compose and return all the information that we want to display on the UI in a single request/response.

GET registry.gitlab.com/gitlab/v1/repositories/<repository>/tags/<name>

Example for a simple image (we'll have to think about the fields and names, this is just a very quick example):

{
  "repository": "registry-tests/alpine",
  "name": "single-tag",
  "image": {
    "size_bytes": 4089942,
    "manifest": {
      "digest": "sha256:809e3719d774a142b94a136bf4c5b1820a4b08df13030766ebf881c6a167ddb1",
      "media_type": "application/vnd.docker.distribution.manifest.v2+json"
    },
    "config": {
      "digest": "sha256:36f6717fe9ce3299c0f37b22070e4a6a4cc04894c1f2ad76168b7901c6a69b0c",
      "media_type": "application/vnd.docker.container.image.v1+json",
      "platform": {
        "architecture": "arm64",
        "os": "linux"
      }
    }
  },
  "created_at": "2025-01-08T05:44:46.903Z",
  "published_at": "2025-01-08T05:44:46.903Z"
}

Example for a multi-arch image:

{
  "repository": "registry-tests/alpine",
  "name": "latest",
  "image": {
    "size_bytes": 0,
    "manifest": {
      "digest": "sha256:a1ece4724f993672b377513a58fb18e13e0364a5cffdb46177354089d0e02d72",
      "media_type": "application/vnd.oci.image.index.v1+json",
      "references": [
        {
          "size_bytes": 1931,
          "manifest": {
            "digest": "sha256:4afbd11717f09ec99e4232ea19c7fc0ea716dc59cb9b8c0d9cbbe4f727aaafb9",
            "media_type": "application/vnd.oci.image.manifest.v1+json"
          },
          "config": {
            "digest": "sha256:4bbbd72e6f3d58c7310d564c91e3d9afe6d48c4ea9e634d4b2dd15c9fb6564cf",
            "media_type": "application/vnd.oci.image.config.v1+json",
            "platform": {
              "architecture": "unknown",
              "os": "unknown"
            }
          }
        },
        {
          "size_bytes": 3101108,
          "manifest": {
            "digest": "sha256:b66c81b4fbc419a5ba38c0b3596470c3353c65a10a1b23d13a649dd0b1ac6c8a",
            "media_type": "application/vnd.oci.image.manifest.v1+json"
          },
          "config": {
            "digest": "sha256:ef4ebc03a8c557761684ccb50b71bf6c527177b5bf4d603fa1b96f2e81ceb33b",
            "media_type": "application/vnd.oci.image.config.v1+json",
            "platform": {
              "architecture": "arm",
              "os": "linux"
            }
          }
        },
        {
          "size_bytes": 1925,
          "manifest": {
            "digest": "sha256:7348a8a2b3827bda523d23dc23453d84c9885c624945f9d8a926d496278508b5",
            "media_type": "application/vnd.oci.image.manifest.v1+json"
          },
          "config": {
            "digest": "sha256:f9b5444b1ae2f290c136c4fad5ffd03cfb2c482e74c73c99cb0c8ece9df91092",
            "media_type": "application/vnd.oci.image.config.v1+json",
            "platform": {
              "architecture": "unknown",
              "os": "unknown"
            }
          }
        },
        {
          "size_bytes": 3645504,
          "manifest": {
            "digest": "sha256:f3c6421ad68a80ea15ec2c6b1e8b5009b654dd2be30f7ed9dda6630e72f2f4af",
            "media_type": "application/vnd.oci.image.manifest.v1+json"
          },
          "config": {
            "digest": "sha256:4048db5d36726e313ab8f7ffccf2362a34cba69e4cdd49119713483a68641fce",
            "media_type": "application/vnd.oci.image.config.v1+json",
            "platform": {
              "architecture": "amd64",
              "os": "linux"
            }
          }
        }
      ]
    }
  },
  "created_at": "2024-12-10T06:52:03.261Z",
  "published_at": "2024-12-10T06:52:03.261Z"
}

Essentially, this API will let us join useful details about the tag itself, the manifest and the configuration of the tagged image in a single request/response.

For reference, Docker API has an endpoint similar to what we want https://docs.docker.com/reference/api/hub/latest/#tag/repositories/paths/~1v2~1namespaces~1%7Bnamespace%7D~1repositories~1%7Brepository%7D~1tags~1%7Btag%7D/get

Edited by Jaime Martinez