Skip to content

Commit 8d87d35

Browse files
committed
Initial PR to propose updates to tag listing
Signed-off-by: Jeff Carter <[email protected]>
1 parent 583e014 commit 8d87d35

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

spec.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,52 @@ The tags MUST be in lexical order.
559559

560560
When using the `last` query parameter, the `n` parameter is OPTIONAL.
561561

562+
Registries MAY support an enhanced tag listing experience when clients pass an `Accept` header value of
563+
`application/vnd.oci.image.index.v1+json`. If a registry supports this mode, they MUST support these additional query parameters:
564+
* `sort_by` - allowed values are `created_at`, `name`
565+
* `sort_order` - allowed values are `asc` and `desc`
566+
567+
The response MUST be a json body in the following format:
568+
```json
569+
{
570+
"schemaVersion": 2,
571+
"mediaType": "application/vnd.oci.image.index.v1+json",
572+
"manifests": [
573+
{
574+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
575+
"size": 1234,
576+
"digest": "sha256:a1a1a1...",
577+
"annotations": {
578+
"org.opencontainers.image.ref.created": "2022-01-01T14:42:55Z",
579+
"org.opencontainers.image.ref.name": "<tag1>"
580+
}
581+
},
582+
{
583+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
584+
"size": 1234,
585+
"digest": "sha256:a2a2a2...",
586+
"annotations": {
587+
"org.opencontainers.image.ref.created": "2022-01-01T07:21:33Z",
588+
"org.opencontainers.image.ref.name": "<tag2>"
589+
}
590+
}
591+
]
592+
}
593+
```
594+
The following annotations MUST be included:
595+
* `org.opencontainers.image.ref.created` - Date and time the reference was created (date-time string as defined by RFC 3339). If unknown, default to epoch.
596+
* `org.opencontainers.image.ref.name` - Reference name of the manifest.
597+
598+
The following annotations MAY be included:
599+
* `org.opencontainers.image.created` - Date and time on which the image was built (date-time string as defined by RFC 3339).
600+
* `org.opencontainers.image.pull.count` - Number of times the image has been pulled from the registry.
601+
* `org.opencontainers.image.pull.timestamp` - Date and time on which the image was last pulled from the registry.
602+
562603
_Implementers note:_
563604
Previous versions of this specification did not include the `Link` header.
564605
Clients depending on the number of tags returned matching `n` may prematurely stop pagination on registries using the `Link` header.
565-
When available, clients should prefer the `Link` header over using the `last` parameter for pagination.
606+
When available, clients should prefer the `Link` header over using the `last` parameter for pagination. If using enhanced
607+
tag listing, the `Link` header MUST be provided.
566608

567609
##### Listing Referrers
568610

0 commit comments

Comments
 (0)