Skip to content

Conversation

@syed
Copy link

@syed syed commented Jan 21, 2026

Based on the discussion on the call, we want to have Docker-Content-Digest as a required header when doing a HEAD on a reference. This fixes an issue where given a tag for a manifest, there is no way currently for the client to know which hashing algorithm was used when pushing

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (non-binding, obviously)

@syed syed force-pushed the head-requests-digest branch 5 times, most recently from 7253851 to 198bc28 Compare January 21, 2026 02:49
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the goal from our conversation is to make it possible to verify the digest of a tag to attach referrers and pin references, I'm also looking at other parts of the spec. Specifically, in a few places we have:

The Docker-Content-Digest header, if present on the response, returns the canonical digest ...

Our usage of "canonical digest" references sha256, so I think the language there should be adjusted to reference the pushed digest when available. Though perhaps we want to save that change for once we have a way to push a tagged manifest with a different digest algorithm.

spec.md Outdated
Comment on lines 213 to 214
A successful response SHOULD contain the digest of the uploaded blob or manifest in the header `Docker-Content-Digest`.
A successful response SHOULD contain the size in bytes of the uploaded blob or manifest in the header `Content-Length`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the community consider changing this to a MUST? It would only apply to newer versions of the spec, so if we did that, I'd also want an implementers note for clients warning that older versions of the spec did not require the header.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not opposed to changing it to a MUST

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about the language around the GET. I believe we should also change this to a MUST to be consistent

A GET request to an existing manifest URL MUST provide the expected manifest, with a response code that MUST be `200 OK`.
A successful response SHOULD contain the digest of the uploaded blob in the header `Docker-Content-Digest`.

The `Docker-Content-Digest` header, if present on the response, returns the canonical digest of the uploaded blob which MAY differ from the provided digest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it would need to be changed throughout to be consistent. Lets get some other maintainers to weigh in before updating the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SHOULD is strong enough for the case where the client only expects sha256 default digests, but we need to explain the digest issue in the specification and how/why it MUST be there in the case where the digest is not, for any reason, already known by the client.

@sudo-bmitch sudo-bmitch mentioned this pull request Jan 21, 2026
3 tasks
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the purposes of documenting the issue outside the call..

The originally added text "These headers are OPTIONAL and clients SHOULD NOT depend on them." Appears to have been written in error and only meant to cover the version header and was not meant for the digest.

see suggested changes.

spec.md Outdated
Comment on lines 213 to 214
A successful response SHOULD contain the digest of the uploaded blob or manifest in the header `Docker-Content-Digest`.
A successful response SHOULD contain the size in bytes of the uploaded blob or manifest in the header `Content-Length`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SHOULD is strong enough for the case where the client only expects sha256 default digests, but we need to explain the digest issue in the specification and how/why it MUST be there in the case where the digest is not, for any reason, already known by the client.

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the SHOULD -> MUST changes LGTM. I don't think we ever define "canonical digest" anywhere, perhaps we should have an entry in the definitions.

@syed
Copy link
Author

syed commented Jan 29, 2026

Overall, the SHOULD -> MUST changes LGTM. I don't think we ever define "canonical digest" anywhere, perhaps we should have an entry in the definitions.

I am thinking of removing the word canonical completely from the spec. We can add a note saying if no digest is specified or returned, assume sha256

dmcgowan
dmcgowan previously approved these changes Jan 29, 2026
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One line needs to get added back. And we need to squash the commits. After that, it LGTM.

@sudo-bmitch
Copy link
Contributor

Thanks. Please squash the commits and I'll give it my 👍🏼 .

- Change Docker-Content-Digest from SHOULD to MUST for GET requests
  on manifests and blobs
- Change Docker-Content-Digest and Content-Length from SHOULD to MUST
  for HEAD requests on manifests and blobs
- Add implementers note for clients encountering older registries that
  may not include the header, suggesting sha256 as a reasonable default
- Remove "canonical" qualifier from digest language throughout spec
- Update legacy Docker support section to reference spec documentation
@syed syed force-pushed the head-requests-digest branch from 08b1331 to 8056120 Compare January 29, 2026 20:19
@syed
Copy link
Author

syed commented Jan 29, 2026

squashed

@sudo-bmitch
Copy link
Contributor

squashed

Looks like the DCO signoff got lost (or maybe wasn't there). git rebase HEAD~1 --signoff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants