jib icon indicating copy to clipboard operation
jib copied to clipboard

Add support for specifying user-defined OCI Annotations

Open markallanson opened this issue 5 months ago • 1 comments

Environment:

  • Jib version: Gradle Plugin version 3.4.5
  • Build tool: Gradle v8.10.1
  • OS: Any & All

Description of the feature: Currently, JIB inserts a single static OCI annotation when building a container using the OCI ImageFormat, and there is no way for user defined annotations to be added to the built image.

It would be nice if OCI image formats could be customized with user defined annotations.

There would be 2 options for implementing this, as far as I could see.

  1. Derive manifest annotations from the existing labels (container.labels) that are already supported.
  2. A completely separate configuation (container.annotations).

In addition there would need to be some construct for allowing the specification of annotations at the index level.

I think either would be a workable solution, and don't personally have a preference or opinion one way or the other.

Expected behavior: Jib supports the ability to emit user-defined annotations into an OCI formatted container image.

Steps to reproduce: Not Applicable

jib-gradle-plugin Configuration:

jib {
    container {
        creationTime.set("USE_CURRENT_TIMESTAMP")
    }
}

Log output: N/A

Additional Information: N/A

markallanson avatar Jul 25 '25 12:07 markallanson

If the maintainers are happy with converting Labels into Annotations then this could be satisified for the manifests, but something new would be needed for the image index annotations.

markallanson avatar Jul 25 '25 12:07 markallanson