fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.87k stars 640 forks source link

buildx support builds unwanted image with OS and architecture unkown/unknown #1732

Open obfischer opened 8 months ago

obfischer commented 8 months ago

Description

Unfortunately we hat do remove the Docker Maven Plugin from our project, as the support of buildx lead to unwanted additional images in the OCI index.

Each image we build had a tiny additional image in its OCI index listet without architecture and OS inforamation. Furthermore Trivy was unable to scan it because of errors.

As a successfull Trivy scan is required for an image to promoted to the next stage, I had to decide to kick out the plugin and to replace it by calls to docker ... via the Maven Exec Plugin.

Here is a screenshot from Harbor grafik

Info

* Docker version :
* If it's a bug, how to reproduce : 24.0.2
* If it's a feature request, what is your use case :
* Sample project : *[GitHub Clone URL]*

As this is a company internal project, I can't provide the hole project, but here is the plugin configuration:
io.fabric8 docker-maven-plugin harbor.acme.com/service/%a:%l ${pbid.docker.plattform} ${project.version} @ Dockerfile ${project.basedir} build-oci-images-for-service package build tag push-oci-image-to-registry deploy push
rhuss commented 8 months ago

Interesting. I'm not so deep in the buildx integration, which is a recent addition. Do you require to use buildx or would the traditional way of building the image also good enough ? (which relies on the architecture of the build system though).

What buildx command are using concrete with maven exec (including command line options). thanks!

obfischer commented 8 months ago

Hi @rhuss, the traditional way would be enough for our use case. We switched to buildx as we had problems with the traditional way, as you called it.

One of my team mates replaced the Docker Maven Plugin by the jib plugin, as we where under high pressure.

Can I help you with other information?

rohanKanojia commented 8 months ago

@obfischer : It's quite strange because other people are also using buildx and no one has reported a problem like this. Could you please provide these?

1.

What buildx command are using concrete with maven exec (including command line options)

  1. What command was DMP trying to execute?

  2. What is value of pbid.docker.plattform?

  3. What docker version are you using?

obfischer commented 8 months ago

Hi @rohanKanojia, this was a freelancing project and the project finished this week. So I don't have access to the code. But the problem was reproducable on Mac, Windows and Linux.

As I can't provide any additional information as the project ended, it is fine for me to close this issue 😢