GoogleContainerTools / GoogleContainerTools/jib

Option to generate metadata about images before building

Open
#4,497 0 comments 0 reactions 0 assignees View on GitHub
priority:p3 type: feature request
Dominant language
Java
Stars
14.5k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

**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:

```json
{
"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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.