@@ -128,7 +128,7 @@ Typically, the first step in pulling an artifact is to retrieve the manifest. Ho
128128
129129##### Pulling manifests
130130
131- To pull a manifest, perform a ` GET ` request to a url in the following form:
131+ To pull a manifest, perform a ` GET ` request to a URL in the following form:
132132` /v2/<name>/manifests/<reference> ` <sup >[ end-3] ( #endpoints ) </sup >
133133
134134` <name> ` refers to the namespace of the repository. ` <reference> ` MUST be either (a) the digest of the manifest or (b) a tag name.
@@ -137,26 +137,41 @@ The `<reference>` MUST NOT be in any other format. Throughout this document, `<n
137137` [a-z0-9]+([._-][a-z0-9]+)*(/[a-z0-9]+([._-][a-z0-9]+)*)* `
138138
139139A GET request to an existing manifest URL MUST provide the expected manifest, with a response code that MUST be ` 200 OK ` .
140+ A successful response SHOULD contain the digest of the uploaded blob in the header ` Docker-Content-Digest ` .
140141
141- The ` OCI-Content-Digest ` header (or, as a fallback, ` Docker-Content-Digest ` header) , if present on the response, returns the canonical
142+ The ` Docker-Content-Digest ` header, if present on the response, returns the canonical
142143digest of the uploaded blob which MAY differ from the provided digest. If the digest does differ, it MAY be the case that
143144the hashing algorithms used do not match. See [ Content Digests] ( ./detail.md ) for information on how to detect the hashing
144145algorithm in use. Most clients MAY ignore the value, but if it is used, the client MUST verify the value against the uploaded
145146blob data.
146147
147148If the manifest is not found in the registry, the response code MUST be ` 404 Not Found ` .
148149
149- ##### Pulling Blobs
150+ ##### Pulling blobs
150151
151- To pull a blob, perform a ` GET ` request to a url in the following form:
152+ To pull a blob, perform a ` GET ` request to a URL in the following form:
152153` /v2/<name>/blobs/<digest> ` <sup >[ end-2] ( #endpoints ) </sup >
153154
154155` <name> ` is the namespace of the repository, and ` <digest> ` is the blob's digest.
155156
156157A GET request to an existing blob URL MUST provide the expected blob, with a response code that MUST be ` 200 OK ` .
158+ A successful response SHOULD contain the digest of the uploaded blob in the header ` Docker-Content-Digest ` . If present,
159+ the value of this header MUST be a digest matching that of the response body.
157160
158161If the blob is not found in the registry, the response code MUST be ` 404 Not Found ` .
159162
163+ ##### Checking if content exists in the registry
164+
165+ In order to verify that a repository contains a given manifest or blob, make a ` HEAD ` request to a URL in the following form:
166+
167+ ` /v2/<name>/manifests/<reference> ` <sup >[ end-3] ( #endpoints ) </sup > (for manifests), or
168+
169+ ` /v2/<name>/blobs/<digest> ` <sup >[ end-2] ( #endpoints ) </sup > (for blobs).
170+
171+ A HEAD request to an existing blob or manifest URL MUST return ` 200 OK ` . A successful response SHOULD contain the digest
172+ of the uploaded blob in the header ` Docker-Content-Digest ` .
173+
174+ If the blob or manifest is not found in the registry, the response code MUST be ` 404 Not Found ` .
160175
161176#### Push
162177
@@ -452,21 +467,21 @@ of this specification.
452467
453468#### Endpoints
454469
455- | ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
456- | ------ | -------- | ----------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
457- | end-1 | ` GET ` | ` /v2/ ` | ` 200 ` | ` 404 ` /` 401 ` |
458- | end-2 | ` GET ` | ` /v2/<name>/blobs/<digest> ` | ` 200 ` | ` 404 ` |
459- | end-3 | ` GET ` | ` /v2/<name>/manifests/<reference> ` | ` 200 ` | ` 404 ` |
460- | end-4a | ` POST ` | ` /v2/<name>/blobs/uploads/ ` | ` 202 ` | ` 404 ` |
461- | end-4b | ` POST ` | ` /v2/<name>/blobs/uploads/?digest=<digest> ` | ` 201 ` /` 202 ` | ` 404 ` /` 400 ` |
462- | end-5 | ` PATCH ` | ` /v2/<name>/blobs/uploads/<reference> ` | ` 202 ` | ` 404 ` /` 416 ` |
463- | end-6 | ` PUT ` | ` /v2/<name>/blobs/uploads/<reference>?digest=<digest> ` | ` 201 ` | ` 404 ` /` 400 ` |
464- | end-7 | ` PUT ` | ` /v2/<name>/manifests/<reference> ` | ` 201 ` | ` 404 ` |
465- | end-8a | ` GET ` | ` /v2/<name>/tags/list ` | ` 200 ` | ` 404 ` |
466- | end-8b | ` GET ` | ` /v2/<name>/tags/list?n=<integer>&last=<integer> ` | ` 200 ` | ` 404 ` |
467- | end-9 | ` DELETE ` | ` /v2/<name>/manifests/<reference> ` | ` 202 ` | ` 404 ` /` 400 ` /` 405 ` |
468- | end-10 | ` DELETE ` | ` /v2/<name>/blobs/<digest> ` | ` 202 ` | ` 404 ` /` 405 ` |
469- | end-11 | ` POST ` | ` /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace> ` | ` 201 ` | ` 404 ` |
470+ | ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
471+ | ------ | -------------- | ----------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
472+ | end-1 | ` GET ` | ` /v2/ ` | ` 200 ` | ` 404 ` /` 401 ` |
473+ | end-2 | ` GET ` / ` HEAD ` | ` /v2/<name>/blobs/<digest> ` | ` 200 ` | ` 404 ` |
474+ | end-3 | ` GET ` / ` HEAD ` | ` /v2/<name>/manifests/<reference> ` | ` 200 ` | ` 404 ` |
475+ | end-4a | ` POST ` | ` /v2/<name>/blobs/uploads/ ` | ` 202 ` | ` 404 ` |
476+ | end-4b | ` POST ` | ` /v2/<name>/blobs/uploads/?digest=<digest> ` | ` 201 ` /` 202 ` | ` 404 ` /` 400 ` |
477+ | end-5 | ` PATCH ` | ` /v2/<name>/blobs/uploads/<reference> ` | ` 202 ` | ` 404 ` /` 416 ` |
478+ | end-6 | ` PUT ` | ` /v2/<name>/blobs/uploads/<reference>?digest=<digest> ` | ` 201 ` | ` 404 ` /` 400 ` |
479+ | end-7 | ` PUT ` | ` /v2/<name>/manifests/<reference> ` | ` 201 ` | ` 404 ` |
480+ | end-8a | ` GET ` | ` /v2/<name>/tags/list ` | ` 200 ` | ` 404 ` |
481+ | end-8b | ` GET ` | ` /v2/<name>/tags/list?n=<integer>&last=<integer> ` | ` 200 ` | ` 404 ` |
482+ | end-9 | ` DELETE ` | ` /v2/<name>/manifests/<reference> ` | ` 202 ` | ` 404 ` /` 400 ` /` 405 ` |
483+ | end-10 | ` DELETE ` | ` /v2/<name>/blobs/<digest> ` | ` 202 ` | ` 404 ` /` 405 ` |
484+ | end-11 | ` POST ` | ` /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace> ` | ` 201 ` | ` 404 ` |
470485
471486#### Error Codes
472487
0 commit comments