Skip to content

Commit 3b30a77

Browse files
committed
artifacts-guidance: better define Artifact and Image
Better define images and artifacts conceptually, and add additional guidance on detecting them in code/at a data-model level. Signed-off-by: Bjorn Neergaard <[email protected]>
1 parent 162a9c8 commit 3b30a77

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

artifacts-guidance.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
# Guidance for Artifacts Authors
22

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), processed according to [conversion.md](conversion.md) to derive a [runtime-spec][] configuration blob.
8+
Conversely, an Artifact is any other conformant content that **does not contain a config to be interpreted by a runtime-spec implementation using the conversion mechanism.
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).
614
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+
Software following the process described in [conversion.md](conversion.md) to create a [runtime-spec][] configuration blob 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 implementations may also be able to interpret known Artifact types; 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

Comments
 (0)