From 561de2dab14a5d3b2e390b029966eafddbc7a448 Mon Sep 17 00:00:00 2001 From: Aaron Friel Date: Wed, 1 Mar 2023 18:30:20 -0800 Subject: [PATCH] image manifest: support use as artifact Implementations lack any information to determine whether the `config` property of an Image Manifest describes the `artifactType` of the manifest, or the media type of the referenced content. This is necessitated by the removal of artifact manifest (#999) and addition of scratch descriptors (#1023) to support artifacts. If #999 is withdrawn, this pull request should be withdrawn as well and #1028 considered instead. Signed-off-by: Aaron Friel --- descriptor.md | 2 +- manifest.md | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/descriptor.md b/descriptor.md index 7a1fb9e1f..87194dc63 100644 --- a/descriptor.md +++ b/descriptor.md @@ -18,7 +18,7 @@ The following fields contain the primary properties that constitute a Descriptor - **`mediaType`** *string* - This REQUIRED property MUST either contain the media type of the referenced content, or contain one of the legacy artifact types predating OCI 1.1 described on the config property of [image manifest](manifest.md). + This REQUIRED property MUST contain the media type of the referenced content unless this descriptor is the `config` property of an [image manifest](manifest.md). Values MUST comply with [RFC 6838][rfc6838], including the [naming requirements in its section 4.2][rfc6838-s4.2]. diff --git a/manifest.md b/manifest.md index 5d3cfb770..9ecb4fd54 100644 --- a/manifest.md +++ b/manifest.md @@ -33,28 +33,23 @@ Unlike the [image index](image-index.md), which contains information about a set - **`mediaType`** *string* - This [descriptor property](descriptor.md#properties) has additional restrictions for `config`. - Implementations MUST support at least the following media types: - - - [`application/vnd.oci.image.config.v1+json`](config.md) - - Manifests concerned with portability SHOULD use one of the above media types. + This [descriptor property](descriptor.md#properties) has different restrictions for `config`. + This value is the `artifactType` property of descriptors referencing this manifest. - **Legacy artifact types** + Implementations MUST NOT attempt to parse the referenced content if this media type is unknown and instead consider the referenced content as arbitrary binary data (e.g.: as `application/octet-stream`). - Artifacts using [image manifest](manifest.md) MAY set the `mediaType` of their `config` property to one of the following: + If this manifest is intended for use by [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec) implementations, the following additional restrictions apply to this property: - - `application/vnd.cncf.helm.config.v1+json`, describing a Helm Chart artifact + Manifests concerned with portability SHOULD use one of the following media types: - - `application/vnd.sylabs.sif.config.v1+json`, describing a Singularity - - This list may be amended as needed to describe use of image manifest prior to OCI 1.1. - - Implementations SHOULD NOT attempt to parse the referenced content or the layers of unexpected media types, and SHOULD treat unknown data as opaque data (e.g.: `application/octet-stream`). + - [`application/vnd.oci.image.config.v1+json`](config.md) - **`layers`** *array of objects* Each item in the array MUST be a [descriptor](descriptor.md). + + If this manifest is intended for use by [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec) implementations, the following additional restrictions apply to this property: + The array MUST have the base layer at index 0. Subsequent layers MUST then follow in stack order (i.e. from `layers[0]` to `layers[len(layers)-1]`). The final filesystem layout MUST match the result of [applying](layer.md#applying-changesets) the layers to an empty directory. @@ -73,7 +68,6 @@ Unlike the [image index](image-index.md), which contains information about a set - [`application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`](layer.md#gzip-media-types) Manifests concerned with portability SHOULD use one of the above media types. - An encountered `mediaType` that is unknown to the implementation MUST NOT generate an error. Entries in this field will frequently use the `+gzip` types.