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 motivation here: https://articles.imjasonh.com/oci-base-image-annotations
This was based in part on work done by buildpacks, specifically the run-image.topLayer label, described here.
The hope is that, by standardizing how to communicate base image information, build tools like buildpacks and generalized rebase tooling consuming the data can interoperate.
I'd like to discuss and propose having the buildpacks spec recommend that implementations set these annotations, in addition to the existing base lifecycle.metadata labels already specified, and for the reference implementation in lifecycle to set it as well.
AFAIK this shouldn't require fundamentally new work, since implementations already need to be able to set the runImage.topLayer and runImage.reference -- this would just be a slightly different phrasing of that information, in a slightly different place, and codified as a recommendation in the spec.
The OCI spec recently added specification for two new standard annotations, to facilitate pointing to a base image:
More details and motivation here: https://articles.imjasonh.com/oci-base-image-annotations
This was based in part on work done by buildpacks, specifically the
run-image.topLayerlabel, described here.The hope is that, by standardizing how to communicate base image information, build tools like buildpacks and generalized rebase tooling consuming the data can interoperate.
I'd like to discuss and propose having the buildpacks spec recommend that implementations set these annotations, in addition to the existing base
lifecycle.metadatalabels already specified, and for the reference implementation in lifecycle to set it as well.AFAIK this shouldn't require fundamentally new work, since implementations already need to be able to set the
runImage.topLayerandrunImage.reference-- this would just be a slightly different phrasing of that information, in a slightly different place, and codified as a recommendation in the spec.