|
1 | 1 | # Guidance for Artifacts Authors |
2 | 2 |
|
3 | | -Content other than OCI container images MAY be packaged using the image manifest. |
4 | | -When this is done, the `config.mediaType` value should not be a known OCI image config [media type](media-types.md). |
5 | | -Historically, due to registry limitations, some tools have created non-OCI conformant artifacts using the `application/vnd.oci.image.config.v1+json` value for `config.mediaType` and values specific to the artifact in `layer[*].mediaType`. |
| 3 | +## Artifacts and Images |
| 4 | + |
| 5 | +This specification is primarily concerned with packaging two kinds of content: Artifacts and Images. |
| 6 | +Both are representing using a [manifest](manifest.md). |
| 7 | +Images are defined in this specification as conformant content with a conformant [config](config.md), intended to be used with a high-level container runtime to derive a [runtime-spec][] container specification. |
| 8 | +Conversely, an Artifact is any other conformant content that **does not contain a config to be interpreted by a runtime-spec implementation.** |
| 9 | + |
| 10 | +## Creating an Artifact |
| 11 | + |
| 12 | +Content other than Images MAY be packaged using the [manifest]; this is otherwise known as an Artifact. |
| 13 | +When this is done, the `artifactType` should be set to a custom media type, or the `config.mediaType` should not be a known Image config [media type](media-types.md). |
6 | 14 | Implementation details and examples are provided in the [image manifest specification](manifest.md#guidelines-for-artifact-usage). |
| 15 | + |
| 16 | +Note: Historically, due to registry limitations, some tools have created non-conformant Artifacts using the `application/vnd.oci.image.config.v1+json` value for `config.mediaType`. |
| 17 | + |
| 18 | +## Interacting with Artifacts |
| 19 | + |
| 20 | +Runtimes implementing the [runtime-spec] SHOULD ignore unknown Artifacts (as determined by the presence of a descriptor `artifactType`) when selecting content from an [index](image-index.md). |
| 21 | +It is possible that software implementing the runtime-spec may also be able to interpret Artifacts; however that is outside the scope of this spec. |
| 22 | + |
| 23 | +Artifacts can be detected at runtime using by checking two keys: |
| 24 | +1. Is an `artifactType` present in the descriptor, or in the [manifest](manifest.md)? |
| 25 | +2. Is the `config.mediaType` of the manifest something other than a [known media type](media-types.md) for [config](config.md)? |
| 26 | + |
| 27 | +If either of these tests is true, then the content is an Artifact. |
| 28 | + |
| 29 | +[runtime-spec]: https://github.com/opencontainers/runtime-spec/blob/main/spec.md |
| 30 | + |
0 commit comments