opencontainers / image-spec

OCI Image Format
https://www.opencontainers.org/
Apache License 2.0
3.34k stars 624 forks source link

Question: How to set proper artifactType #1143

Open chlins opened 8 months ago

chlins commented 8 months ago

By referring to the information provided in the artifact guidelines, users can effectively build non-image artifacts. In cases where an artifact does not have a specific config layer, the config can be supplemented with an empty layer. The media type can be specified in the artifactType field. For instance, an example value is application/vnd.example+type. I would like to clarify the meaning of the +type component in this context. Is it similar to +json or +xml? I am confused because the artifactType already represents the type, so the inclusion of the format type only seems relevant if it pertains to the config.mediaType. Could you please provide more guidance or suggestions on defining a proper artifactType?

sudo-bmitch commented 8 months ago

The artifactType field is defined above:

This OPTIONAL property contains the type of an artifact when the manifest is used for an artifact. This MUST be set when config.mediaType is set to the empty value. If defined, the value MUST comply with RFC 6838, including the naming requirements in its section 4.2, and MAY be registered with IANA. Implementations storing or copying image manifests MUST NOT error on encountering an artifactType that is unknown to the implementation.

See the RFC links for details about the syntax for a media type, and the link to the already registered IANA media types serve as a list of examples.

KUNNATHFAHAD commented 7 months ago

https://github.com/opencontainers/image-spec/issues/1143#issuecomment-1771193942