Skip to content

Image index media type and annotation #5051

@ok-ryoko

Description

@ok-ryoko

For tighter integration with some container registries such as ghcr.io, I want to annotate multi-architecture image indexes. I understand that only media of type application/vnd.oci.image.index.v1+json support annotations. However, I’m unable to create an image index of this type using either Buildah or Podman. Moreover, there doesn’t seem to be a way to annotate image indexes—only images referenced by an index.

Steps to reproduce the issue:

$ buildah manifest create manticore && buildah manifest inspect manticore

Describe the results you received:

f25e51ee5f0a3be38ae63b954aa4a2367c20e514a9f66a007975ee1db8e9a217
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "manifests": null
}

Describe the results you expected:

f25e51ee5f0a3be38ae63b954aa4a2367c20e514a9f66a007975ee1db8e9a217
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": null
}

… because, as I understand it, conformance with OCI specifications is a high priority to Buildah, and Buildah defaults to using the OCI format in other operations, such as committing and pushing images.

Output of buildah version:

Version:         1.31.3
Go Version:      go1.19.12
Image Spec:      1.1.0-rc.3
Runtime Spec:    1.1.0-rc.3
CNI Spec:        1.0.0
libcni Version:
image Version:   5.26.2
Git Commit:
Built:           Fri Aug 25 08:51:43 2023
OS/Arch:         linux/amd64
BuildPlatform:   linux/amd64

In cmd/buildah/manifest.go, the manifest type is currently fixed to manifest.DockerV2ListMediaType.

Could manifest create take a --format option (the same way that push and commit do) and respect the BUILDAH_FORMAT environment variable?

Could manifest annotate annotate the image index directly if (1) the media type is appropriate and (2) no image manifest digest is provided?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions