GoogleContainerTools/jib

It's likely that one of the dependencies that have the same name will not have their jar included in the image

erdi opened this issue · 1 comments

erdi commented

Environment:

  • Jib version: 3.4.0
  • Build tool: Gradle 8.5
  • OS: MacOS 14.3

Description of the issue:

It's likely that one of the dependencies that have the same name will not have their jar included in the image because the size of the jar is used as a file name differentiator for such dependencies.

Expected behavior:

It's extremely unlikely or even impossible for dependencies that have the same name to have their jar not included in the image.

Steps to reproduce:

  1. Use jib to build an image for a project that has two dependencies of the same name for which the size of their jar is also the same.
  2. Inspect the image and see that only one of the jars is included in the image.

Additional Information:

We have seen this happen in our project - we started getting ClassNotFoundExceptions inside of a container for a class that should be available and I tracked it down to two dependencies having the same name and same size of the jar file causing one of them to not be included in the image anymore.

I'm willing to provide a PR changing the file name differentiator to use a sequence number or hash of the file contents to resolve this issue. Please let me know if such PR would be considered before I put in the effort for it to be rejected straight away.

Would there be any interest in a PR as offered in the issue description, @alicejli?