Skip to content

Use image metadata (labels, annotations) to drive automated image re-builds #1602

Description

@lbussell

Related: dotnet/dotnet-docker#5531

If we added the following OCI image annotations, we could use this information to drive our automatic image rebuilds instead of keeping track of and updating image-info files.

  • org.opencontainers.image.source: URL to get source code for building the image (string). This would be equivalent to image info's commitUrl
  • org.opencontainers.image.base.digest: Digest that the image is based on (string). Equivalent to image-info's baseImageDigest.
  • org.opencontainers.image.base.name (optional?): fully qualified base image name. I don't think this is completely necessary since we can query the Dockerfile for this information. However, we have this information, and adding it would make it easier for users to determine if our images are out of date without checking the Dockerfile.

To implement this, we'd need:

  • Add the option to set annotations during image builds
    • This is done using the --annotation "foo=bar" argument for docker build [source]
    • Could be turned on/off via the manifest or a build command option for ImageBuilder.
  • Add the capability to use image annotations in GetStaleImagesCommand

Activity

  1. added theissue type on Feb 24, 2025
  2. mthalman commented on Mar 18, 2026

    @mthalman
    Member

    Having these annotations would also be helpful for this scenario: dotnet/arcade#16602

  3. lbussell commented on Jun 30, 2026

    @lbussell
    MemberAuthor

    Since annotations are an OCI-only thing, this would require dotnet/dotnet-docker#6148.

    However, we can use image labels (on the image config) for the same purpose, even with the same keys/values. Even if we decided to move to OCI + annotations, keeping labels around with the same values is apparently common practice.

  4. changed the title [-]Use OCI image annotations to drive automated image re-builds[/-] [+]Use image metadata (labels, annotations) to drive automated image re-builds[/+] on Jun 30, 2026
  5. added a commit that references this issue on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions