Skip to content

Commit a43286b

Browse files
vbattssudo-bmitch
authored andcommitted
spec and README: reduce to just image-manifest
This change corresponds with opencontainers/image-spec#999 as we reconcile changes needed to allow referrers API (`subject` field and `artifactType` field responses) to function smoothly on image-manifest. Personal take on this: After ~~excesive~~ extensive deliberation, that while it would be nice to have a clean-break to work with a generic manifest, we would be setting ourselves and the whole ecosystem up for the compatibility challenges similer to Docker schema 1 -> schema 2 -> OCI v1. The biggest value for the community and ecosystem is to provide guidance on how to use the available data structures and APIs to already accomplish the same use-cases in the most broadly compatible way. Signed-off-by: Vincent Batts <[email protected]>
1 parent 670085c commit a43286b

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ The _optional_ and _base_ layers of all OCI projects are tracked in the [OCI Sco
2020

2121
## Distributing OCI Images and other content
2222

23-
The OCI Distribution Spec is closely related to the [OCI Image Format Specification] project,
24-
the [OCI Runtime Specification] project,
25-
and the [OCI Artifacts] project.
23+
The OCI Distribution Spec is closely related to the [OCI Image Format Specification] project and the [OCI Runtime Specification] project.
2624

2725
The [OCI Image Format Specification] strictly defines the requirements for an OCI Image (container image), which consists of
2826
a manifest, an optional image index, a set of filesystem layers, and a configuration.
@@ -36,14 +34,9 @@ The [OCI Distribution Specification] (this project) is also designed generically
3634
any type of content. The format of uploaded manifests, for example, need not necessarily adhere to the OCI Image Format Specification
3735
so long as it references the blobs which comprise a given artifact.
3836

39-
The [OCI Artifacts] project is an effort to provide guidance on how to
40-
properly define and distribute content using the OCI Distribution Specification for artifacts which are not container filesystem bundles,
41-
in a way that is mostly compatible with the existing schemas defined in the OCI Image Format Specification.
42-
4337
[OCI Image Format Specification]: https://github.com/opencontainers/image-spec
4438
[OCI Runtime Specification]: https://github.com/opencontainers/runtime-spec
4539
[OCI Distribution Specification]: https://github.com/opencontainers/distribution-spec
46-
[OCI Artifacts]: https://github.com/opencontainers/artifacts
4740

4841
## FAQ
4942

spec.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ The **Open Container Initiative Distribution Specification** (a.k.a. "OCI Distri
3636
The specification is designed to be agnostic of content types.
3737
OCI Image types are currently the most prominent, which are defined in the [Open Container Initiative Image Format Specification](https://github.com/opencontainers/image-spec) (a.k.a. "OCI Image Spec").
3838

39-
To support other content types, please see the [Open Container Initiative Artifact Authors Guide](https://github.com/opencontainers/artifacts) (a.k.a. "OCI Artifacts").
40-
4139
### Historical Context
4240

4341
The spec is based on the specification for the Docker Registry HTTP API V2 protocol <sup>[apdx-1](#appendix)</sup>.
@@ -67,10 +65,9 @@ Several terms are used frequently in this document and warrant basic definitions
6765
- **Push**: the act of uploading blobs and manifests to a registry
6866
- **Pull**: the act of downloading blobs and manifests from a registry
6967
- **Blob**: the binary form of content that is stored by a registry, addressable by a digest
70-
- **Manifest**: a JSON document uploaded via the manifests endpoint. A manifest may reference other manifests and blobs in a repository via descriptors. Examples of manifests are defined under the OCI Image Spec <sup>[apdx-2](#appendix)</sup>, such as the image manifest, image index, and artifact manifest.</sup>
68+
- **Manifest**: a JSON document uploaded via the manifests endpoint. A manifest may reference other manifests and blobs in a repository via descriptors. Examples of manifests are defined under the OCI Image Spec <sup>[apdx-2](#appendix)</sup>, such as the image manifest and image index (and legacy manifests).</sup>
7169
- **Image Index**: a manifest containing a list of manifests, defined under the OCI Image Spec <sup>[apdx-6](#appendix)</sup>.
7270
- **Image Manifest**: a manifest containing a config descriptor and an indexed list of layers, commonly used for container images, defined under the OCI Image Spec <sup>[apdx-2](#appendix)</sup>.
73-
- **Artifact Manifest**: a manifest containing a collection of blobs, defined under the OCI Image Spec <sup>[apdx-7](#appendix)</sup>.
7471
- **Config**: a blob referenced in the image manifest which contains metadata. Config is defined under the OCI Image Spec <sup>[apdx-4](#appendix)</sup>.
7572
- **Object**: one conceptual piece of content stored as blobs with an accompanying manifest. (This was previously described as an "artifact", and has been renamed to avoid confusion with the "artifact manifest".)
7673
- **Descriptor**: a reference that describes the type, metadata and content address of referenced content. Descriptors are defined under the OCI Image Spec <sup>[apdx-5](#appendix)</sup>.
@@ -465,15 +462,15 @@ Client and registry implementations SHOULD expect to be able to support manifest
465462

466463
When processing a request for an image or artifact manfiest with the `subject` field, a registry implementation that supports the [referrers API](#listing-referrers) MUST respond with the response header `OCI-Subject: <subject digest>` to indicate to the client that the registry processed the request's `subject`.
467464

468-
When pushing an image or artifact manifest with the `subject` field and the [referrers API](#listing-referrers) returns a 404 or the `OCI-Subject` header was not set, the client MUST:
465+
When pushing a manifest with the `subject` field and the [referrers API](#listing-referrers) returns a 404 or the `OCI-Subject` header was not set, the client MUST:
469466

470467
1. Pull the current referrers list using the [referrers tag schema](#referrers-tag-schema).
471468
1. If that pull returns a manifest other than the expected image index, the client SHOULD report a failure and skip the remaining steps.
472469
1. If the tag returns a 404, the client MUST begin with an empty image index.
473470
1. Verify the descriptor for the manifest is not already in the referrers list (duplicate entries SHOULD NOT be created).
474-
1. Append a descriptor for the pushed image or artifact manifest to the manifests in the referrers list.
475-
The value of the `artifactType` MUST be set in the descriptor to value of the `artifactType` in the artifact manifest, or the config descriptor `mediaType` in the image manifest.
476-
All annotations from the image or artifact manifest MUST be copied to this descriptor.
471+
1. Append a descriptor for the pushed manifest to the manifests in the referrers list.
472+
The value of the `artifactType` MUST be set to the config descriptor `mediaType` in the image manifest.
473+
All annotations from the image manifest MUST be copied to this descriptor.
477474
1. Push the updated referrers list using the same [referrers tag schema](#referrers-tag-schema).
478475
The client MAY use conditional HTTP requests to prevent overwriting a referrers list that has changed since it was first pulled.
479476

@@ -537,9 +534,9 @@ If the registry supports the referrers API, the registry MUST NOT return a `404
537534
If the request is invalid, such as a `<digest>` with an invalid syntax, a `400 Bad Request` MUST be returned.
538535

539536
Upon success, the response MUST be a JSON body with an image index containing a list of descriptors.
540-
Each descriptor is of an image or artifact manifest in the same `<name>` namespace with a `subject` field that specifies the value of `<digest>`.
541-
The descriptors MUST include an `artifactType` field that is set to the value of `artifactType` for an artifact manifest if present, or the configuration descriptor's `mediaType` for an image manifest.
542-
The descriptors MUST include annotations from the image or artifact manifest.
537+
Each descriptor is of an image manifest in the same `<name>` namespace with a `subject` field that specifies the value of `<digest>`.
538+
The descriptors MUST include an `artifactType` field that is set to the value the configuration descriptor's `mediaType` for an image manifest.
539+
The descriptors MUST include annotations from the image manifest.
543540
If a query results in no matching referrers, an empty manifest list MUST be returned.
544541
If a manifest with the digest `<digest>` does not exist, a registry MAY return an empty manifest list.
545542
After a manifest with the digest `<digest>` is pushed, the registry MUST include previously pushed entries in the referrers list.
@@ -560,7 +557,7 @@ After a manifest with the digest `<digest>` is pushed, the registry MUST include
560557
}
561558
},
562559
{
563-
"mediaType": "application/vnd.oci.artifact.manifest.v1+json",
560+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
564561
"size": 1234,
565562
"digest": "sha256:a2a2a2...",
566563
"artifactType": "application/vnd.example.signature.v1",
@@ -636,7 +633,7 @@ To delete a manifest, perform a `DELETE` request to a path in the following form
636633
Upon success, the registry MUST respond with a `202 Accepted` code.
637634
If the repository does not exist, the response MUST return `404 Not Found`.
638635

639-
When deleting an image or artifact manifest that contains a `subject` field, and the [referrers API](#listing-referrers) returns a 404, clients SHOULD:
636+
When deleting an image manifest that contains a `subject` field, and the [referrers API](#listing-referrers) returns a 404, clients SHOULD:
640637

641638
1. Pull the referrers list using the [referrers tag schema](#referrers-tag-schema).
642639
1. Remove the descriptor entry from the array of manifests that references the deleted manifest.
@@ -660,7 +657,7 @@ This section describes client fallback procedures that MUST be implemented when
660657

661658
#### Unavailable Referrers API
662659

663-
A client that pushes an image or artifact manifest with a defined `subject` field MUST verify the [referrers API](#listing-referrers) is available or fallback to updating the image index pushed to a tag described by the [referrers tag schema](#referrers-tag-schema).
660+
A client that pushes an image manifest with a defined `subject` field MUST verify the [referrers API](#listing-referrers) is available or fallback to updating the image index pushed to a tag described by the [referrers tag schema](#referrers-tag-schema).
664661
A client querying the [referrers API](#listing-referrers) and receiving a `404 Not Found` MUST fallback to using an image index pushed to a tag described by the [referrers tag schema](#referrers-tag-schema).
665662

666663
##### Referrers Tag Schema
@@ -800,4 +797,3 @@ The following is a list of documents referenced in this spec:
800797
| apdx-4 | [OCI Image Spec - config](https://github.com/opencontainers/image-spec/blob/v1.0.1/config.md) | Description of configs, defined by the OCI Image Spec |
801798
| apdx-5 | [OCI Image Spec - descriptor](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md) | Description of descriptors, defined by the OCI Image Spec |
802799
| apdx-6 | [OCI Image Spec - index](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md) | Description of image index, defined by the OCI Image Spec |
803-
| apdx-7 | [OCI Image Spec - artifact](https://github.com/opencontainers/image-spec/blob/main/artifact.md) | Description of an artifact manifest, defined by the OCI Image Spec |

0 commit comments

Comments
 (0)