The OCI and Docker media-type strings, with classifiers.
A media type tags what a descriptor points at — a manifest, an index (manifest list), a config, or a layer — and, for layers, how the tar is compressed. Stevedore handles both the OCI and the legacy Docker schema-2 vocabularies, since real registries serve a mix.
Spec: OCI image-spec media-types and the Docker image manifest v2 schema 2.
Summary
Functions
All manifest+index media types, for use in an Accept header.
Whether media_type names an image config.
The Docker image config media type.
The Docker gzip-compressed layer media type.
The Docker schema-2 manifest media type.
Whether a layer media_type is gzip-compressed (+gzip / .tar.gzip).
Whether media_type names a multi-arch index / manifest list.
Whether media_type names a layer.
Whether media_type names a single-image manifest (OCI or Docker).
The OCI image config media type.
The OCI image index (manifest list) media type.
The OCI uncompressed layer media type (a plain tar).
The OCI gzip-compressed layer media type.
The OCI zstd-compressed layer media type.
The OCI image manifest media type.
Whether a layer media_type is zstd-compressed (+zstd).
Functions
@spec all_manifest_types() :: [String.t()]
All manifest+index media types, for use in an Accept header.
Whether media_type names an image config.
@spec docker_config() :: String.t()
The Docker image config media type.
@spec docker_layer_gzip() :: String.t()
The Docker gzip-compressed layer media type.
@spec docker_manifest() :: String.t()
The Docker schema-2 manifest media type.
Whether a layer media_type is gzip-compressed (+gzip / .tar.gzip).
Examples
iex> Stevedore.MediaType.gzip?("application/vnd.oci.image.layer.v1.tar+gzip")
true
iex> Stevedore.MediaType.gzip?("application/vnd.oci.image.layer.v1.tar")
false
Whether media_type names a multi-arch index / manifest list.
Examples
iex> Stevedore.MediaType.index?("application/vnd.docker.distribution.manifest.list.v2+json")
true
Whether media_type names a layer.
Examples
iex> Stevedore.MediaType.layer?("application/vnd.docker.image.rootfs.diff.tar.gzip")
true
Whether media_type names a single-image manifest (OCI or Docker).
Examples
iex> Stevedore.MediaType.manifest?("application/vnd.oci.image.manifest.v1+json")
true
iex> Stevedore.MediaType.manifest?("application/vnd.oci.image.index.v1+json")
false
@spec oci_config() :: String.t()
The OCI image config media type.
@spec oci_index() :: String.t()
The OCI image index (manifest list) media type.
@spec oci_layer() :: String.t()
The OCI uncompressed layer media type (a plain tar).
@spec oci_layer_gzip() :: String.t()
The OCI gzip-compressed layer media type.
@spec oci_layer_zstd() :: String.t()
The OCI zstd-compressed layer media type.
@spec oci_manifest() :: String.t()
The OCI image manifest media type.
Whether a layer media_type is zstd-compressed (+zstd).
Examples
iex> Stevedore.MediaType.zstd?("application/vnd.oci.image.layer.v1.tar+zstd")
true