|
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. Both are representing using a [manifest](manifest.md). |
| 6 | +Images are defined in this specification as conformant content with a [config](config.md), designed to be interpreted by a runtime that implements the [runtime-spec][]. |
| 7 | +Conversely, an Artifact is any other conformant content that **does not contain a config to be interpreted by a runtime-spec implementation.** |
| 8 | + |
| 9 | +## Creating an Artifact |
| 10 | + |
| 11 | +Content other than Images MAY be packaged using the [manifest]; this is otherwise known as an Artifact. |
| 12 | +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 | 13 | Implementation details and examples are provided in the [image manifest specification](manifest.md#guidelines-for-artifact-usage). |
| 14 | + |
| 15 | +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`. |
| 16 | + |
| 17 | +## Interacting with Artifacts |
| 18 | + |
| 19 | +Runtimes implementing the [runtime-spec] SHOULD ignore unknown Artifacts when selecting content from an [index](image-index.md). |
| 20 | +It is possible that softwre implementing the runtime-spec may also be able to interpret Artifacts; however that is outside the scope of this spec. |
| 21 | + |
| 22 | +Artifacts can be detected at runtime using by checking two keys: |
| 23 | +1. Is an `artifactType` present in the descriptor, or in the [manifest](manifest.md)? |
| 24 | +2. Is the `config.mediaType` of the manifest something other than a [known media type](media-types.md) for [config](config.md)? |
| 25 | + |
| 26 | +If either of these tests is true, then the content is an Artifact. |
| 27 | + |
| 28 | +[runtime-spec]: https://github.com/opencontainers/runtime-spec/blob/main/spec.md |
| 29 | + |
0 commit comments