Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

FR: setting OCI base image annotations #1720

@imjasonh

Description

@imjasonh

The OCI spec recently added specification for two new standard annotations, to facilitate pointing to a base image:

  • org.opencontainers.image.base.digest Digest of the image this image is based on (string)
    • This SHOULD be the immediate image sharing zero-indexed layers with the image, such as from a Dockerfile FROM statement.
    • This SHOULD NOT reference any other images used to generate the contents of the image (e.g., multi-stage Dockerfile builds).
  • org.opencontainers.image.base.name Image reference of the image this image is based on (string)
    • This SHOULD be image references in the format defined by distribution/distribution.
    • This SHOULD be a fully qualified reference name, without any assumed default registry. (e.g., registry.example.com/my-org/my-image:tag instead of my-org/my-image:tag).
    • This SHOULD be the immediate image sharing zero-indexed layers with the image, such as from a Dockerfile FROM statement.
    • This SHOULD NOT reference any other images used to generate the contents of the image (e.g., multi-stage Dockerfile builds).
    • If the image.base.name annotation is specified, the image.base.digest annotation SHOULD be the digest of the manifest referenced by the image.ref.name annotation.

More details and further motivation here: https://articles.imjasonh.com/oci-base-image-annotations

I'd like to discuss and propose that kaniko set these annotations on images it produces by default, pointing to the ref and digest of the FROM image that produces the final built image. (note: this does not include any images implicated in multi-stage builds)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/usabilityFor all bugs related to how people use kaniko, option and feature flags, etcfeat/ocikind/feature-requestneeds-discussionItems which need more discussion before commitmentpriority/p3agreed that this would be good to have, but no one is available at the moment.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions