@@ -304,6 +304,29 @@ Location: <blob-location>
304304Here, ` <blob-location> ` is a pullable blob URL.
305305
306306
307+ ##### Mounting a blob from another repository
308+ If a necessary blob exists already in another repository, it can be mounted into a different repository via a ` POST `
309+ request in the following format:
310+
311+ ` /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace> ` <sup >[ end-11] ( #endpoints ) </sup >.
312+
313+ In this case, ` <name> ` is the namespace to which the blob will be mounted. ` <digest> ` is the digest of the blob to mount,
314+ and ` <other_namespace> ` is the namespace from which the blob should be mounted.
315+
316+ The response to a successful mount MUST be ` 201 Created ` , and MUST contain the following header:
317+ ```
318+ Location: <blob-location>
319+ ```
320+
321+ The digest contained in the ` Location ` header MAY be different from that of the blob that was mounted. As such, a client
322+ SHOULD use the digest found in the path from this header and SHOULD NOT use the digest of the blob that was mounted.
323+
324+ The response to an unsuccessful mount MUST be ` 202 Accepted ` , and be handled in the same way as a ` POST ` request to
325+ ` /v2/<name>/blobs/uploads/ ` <sup >[ end-4a] ( #endpoints ) </sup >. That is, it MUST contain the following header, in the following format:
326+ ```
327+ Location: /v2/<name>/blobs/uploads/<session-id>
328+ ```
329+
307330##### Pushing Manifests
308331
309332To push a manifest, perform a ` PUT ` request to a path in the following format, and with the following headers
@@ -414,20 +437,21 @@ of this specification.
414437
415438#### Endpoints
416439
417- | ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
418- | ------ | -------- | ------------------------------------------------------ | ---------------------------------- | ------------------------------- |
419- | end-1 | ` GET ` | ` /v2/ ` | ` 200 ` | ` 404 ` /` 401 ` |
420- | end-2 | ` GET ` | ` /v2/<name>/blobs/<digest> ` | ` 200 ` | ` 404 ` |
421- | end-3 | ` GET ` | ` /v2/<name>/manifests/<reference> ` | ` 200 ` | ` 404 ` |
422- | end-4a | ` POST ` | ` /v2/<name>/blobs/uploads/ ` | ` 202 ` | ` 404 ` |
423- | end-4b | ` POST ` | ` /v2/<name>/blobs/uploads/?digest=<digest> ` | ` 201 ` /` 202 ` | ` 404 ` /` 400 ` |
424- | end-5 | ` PATCH ` | ` /v2/<name>/blobs/uploads/<reference> ` | ` 202 ` | ` 404 ` /` 416 ` |
425- | end-6 | ` PUT ` | ` /v2/<name>/blobs/uploads/<reference>?digest=<digest> ` | ` 201 ` | ` 404 ` /` 400 ` |
426- | end-7 | ` PUT ` | ` /v2/<name>/manifests/<reference> ` | ` 201 ` | ` 404 ` |
427- | end-8a | ` GET ` | ` /v2/<name>/tags/list ` | ` 200 ` | ` 404 ` |
428- | end-8b | ` GET ` | ` /v2/<name>/tags/list?n=<integer>&last=<integer> ` | ` 200 ` | ` 404 ` |
429- | end-9 | ` DELETE ` | ` /v2/<name>/manifests/<reference> ` | ` 202 ` | ` 404 ` /` 400 ` /` 405 ` |
430- | end-10 | ` DELETE ` | ` /v2/<name>/blobs/<digest> ` | ` 202 ` | ` 404 ` /` 405 ` |
440+ | ID | Method | API endpoint | Accepted Successful Response Codes | Accepted Failure Response Codes |
441+ | ------ | -------- | ----------------------------------------------------------------- | ---------------------------------- | ------------------------------- |
442+ | end-1 | ` GET ` | ` /v2/ ` | ` 200 ` | ` 404 ` /` 401 ` |
443+ | end-2 | ` GET ` | ` /v2/<name>/blobs/<digest> ` | ` 200 ` | ` 404 ` |
444+ | end-3 | ` GET ` | ` /v2/<name>/manifests/<reference> ` | ` 200 ` | ` 404 ` |
445+ | end-4a | ` POST ` | ` /v2/<name>/blobs/uploads/ ` | ` 202 ` | ` 404 ` |
446+ | end-4b | ` POST ` | ` /v2/<name>/blobs/uploads/?digest=<digest> ` | ` 201 ` /` 202 ` | ` 404 ` /` 400 ` |
447+ | end-5 | ` PATCH ` | ` /v2/<name>/blobs/uploads/<reference> ` | ` 202 ` | ` 404 ` /` 416 ` |
448+ | end-6 | ` PUT ` | ` /v2/<name>/blobs/uploads/<reference>?digest=<digest> ` | ` 201 ` | ` 404 ` /` 400 ` |
449+ | end-7 | ` PUT ` | ` /v2/<name>/manifests/<reference> ` | ` 201 ` | ` 404 ` |
450+ | end-8a | ` GET ` | ` /v2/<name>/tags/list ` | ` 200 ` | ` 404 ` |
451+ | end-8b | ` GET ` | ` /v2/<name>/tags/list?n=<integer>&last=<integer> ` | ` 200 ` | ` 404 ` |
452+ | end-9 | ` DELETE ` | ` /v2/<name>/manifests/<reference> ` | ` 202 ` | ` 404 ` /` 400 ` /` 405 ` |
453+ | end-10 | ` DELETE ` | ` /v2/<name>/blobs/<digest> ` | ` 202 ` | ` 404 ` /` 405 ` |
454+ | end-11 | ` POST ` | ` /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_namespace> ` | ` 201 ` | ` 404 ` |
431455
432456#### Error Codes
433457
0 commit comments