Adding platform annotations in artifact manifests through --artifact-platform
#1538
Labels
Milestone
--artifact-platform
#1538
Problem
In order to support multi-arch artifacts, we introduced a new
--artifact-platform
flag to theoras push
command in the PR #1500.The current implementation embeds the platform information into the config payload, which looks like this:
We set the config media type to
"application/vnd.oci.image.config.v1+json"
for compatibility reasons, so the config descriptor looks like this:However, we have we identified several problems with this implementation:
Solution
We have opened an issue on the OCI image-spec repo to seek a proper solution for adding platform information into artifacts. While we work towards finding the best approach, we should consider implementing Approach 1 mentioned in the proposal, which offers more advantages over the current implementation.
Adding platform annotations in the manifest
As the OCI community has not yet agreed on this approach, we need to define the annotations under the ORAS namespace instead of the OCI namespace.
For instance, the architecture and OS information could be placed in
land.oras.artifact.platform.architecture
andland.oras.artifact.platform.os
annotations, respectively. Additional details like OS version, OS features, and variant could be included inland.oras.artifact.platform.osversion
,land.oras.artifact.platform.osfeatures
, andland.oras.artifact.platform.variant
.For example, the manifest annotations for a
linux/amd64
artifact would look like this:The complete manifest containing such annotations would then look like this:
This approach is straightforward to implement for both producers and consumers, with annotations that are friendly for humans to read. It also enables end users to query or filter out specific platforms based on annotations when listing manifests. Additionally, the annotations can be applied to platform-specific Image Indexes.
The text was updated successfully, but these errors were encountered: