GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.58k stars 1.43k forks source link

spring boot 3.2 jib build is not reproducible #4163

Open golosegor opened 8 months ago

golosegor commented 8 months ago

Environment:

Description of the issue: Tar build is not reproducible since spring-boot 3.2.0 verison. Below you could find a demo multi-module project to make a repro:

https://github.com/golosegor/spring-boot-3.2-build-reproducible-issue

Expected behavior:

After 2 execution tar has the same md5 hash code.

Steps to reproduce:

  1. Clone the repo https://github.com/golosegor/spring-boot-3.2-build-reproducible-issue
  2. Execute ./gradlew -q clean jibBuildTar && md5sum user-backend/build/jib-image.tar \ &&./gradlew -q clean jibBuildTar && md5sum user-backend/build/jib-image.tar
  3. Ensure you have the different hash summs

This bug is happening since spring-boot 3.2.0. In version 3.1.7 no repro is happening.

If build is happening with buildpack - you won't see the issue. Looks like it is jib-related.

chanseokoh commented 8 months ago

Probably #4141 and #4131.

golosegor commented 8 months ago

forcing the plugin version helped, but it would be great if dependencies for jib is embeded (not sure if it is possible) so people are not facing this issue (below code snippet in kotlin dsl)

buildscript { configurations.all { resolutionStrategy { force("org.apache.commons:commons-compress:1.21") } } }

bjornbugge commented 7 months ago

This will probably be closed with #4142

mpeddada1 commented 5 months ago

@golosegor Quick update: jib-gradle-plugin:3.4.2 has been release with a fix. Please let us know if this addresses your issue?