Skip to content

Option to generate metadata about images before buildingΒ #4497

@fenuks

Description

@fenuks

Description of the issue:
I have a multimodule Maven project that uses jib to containerize microservices.
I would like to generate metadata about images before they are built. Such
metadata could be then used to do some checks before performing an image build,
e.g. to scan base image with trivy and abort building if there are known
vulnerabilities.

Currently, jib generates target/jib-image.json file:

{
  "image": "…",
  "imageId": "sha256:…",
  "imageDigest":"sha256:…",
  "tags": ["…"],
  "imagePushed": true
}

but only after the image is built.

That metadata can be used for checks, but building an image that might be later
discarded is time consuming. Therefore, it would be better if jib could generate
metadata before building or had some kind of dry-run mode.

Possibly this metadata could be sourced independently of jib via mvn help:effective-pom,
but parsing the POM XML quite complicated.

Environment:

  • Jib version: 3.5.1
  • Build tool: maven 3.9.12
  • OS: Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions