You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a feature (e.g. docker.image) that prints the name of the resolved image name.
Info
In our pipeline we use the docker-maven-plugin to build a docker image with docker-build. The subsequent job conducts a security scan of the previously build image with Trivy. However there seems to be no intuitive/stable way of passing the docker image name to trivy (or extract it at all).
possible options we evaluated: regex parsing the build output, mvn help:evaluate the artifact name/plugin config
I suggest implementing a feature (e.g. docker:build -DprintOnly) that resolves all possible flags that can be configured for the Image Name and prints the image name to the console.
A workflow could then look something like the following (simplified for reading purposse):
Umm, If I understand correctly are you asking for printing name of the image built by docker maven plugin? Isn't it something we're doing already? I'm able to see the image name during a normal image build like this:
[INFO] DOCKER> [username/dmp-demo-project:foo] "dockerfile": Built image sha256:d0c66
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.744 s
[INFO] Finished at: 2023-11-17T19:41:32+05:30
[INFO] ------------------------------------------------------------------------
Yes but the only way to extract the image name is by using a regex, which can cause some trouble when using different shells (pipeline vs locally - at least in my experience) and could potentially break if the output of the docker command changes.
Description
Add a feature (e.g.
docker.image
) that prints the name of the resolved image name.Info
In our pipeline we use the
docker-maven-plugin
to build a docker image withdocker-build
. The subsequent job conducts a security scan of the previously build image with Trivy. However there seems to be no intuitive/stable way of passing the docker image name to trivy (or extract it at all).possible options we evaluated: regex parsing the
build
output,mvn help:evaluate
the artifact name/plugin configI suggest implementing a feature (e.g.
docker:build -DprintOnly
) that resolves all possible flags that can be configured for the Image Name and prints the image name to the console.A workflow could then look something like the following (simplified for reading purposse):
If this feature is considered useful, I'd be more than happy to implement this feature myself!
The text was updated successfully, but these errors were encountered: