Skip to content

Commit

Permalink
image manifest: support use as artifact
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
AaronFriel committed Mar 2, 2023
1 parent 047d81c commit 561de2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down
24 changes: 9 additions & 15 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

Expand Down

0 comments on commit 561de2d

Please sign in to comment.