-
Versions
-
spring-boot version: 2.3.3.RELEASE
- jdk version: 11
-
gradle version: 6.4.1
-
Symptom Task :bootBuildImage FAILED
-
Log
$ ./gradlew bootBuildImage
> Task :bootBuildImage
Building image 'docker.io/library/demo:0.0.1-SNAPSHOT'
> Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' ..................................................
> Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:14ddeb46d348e06c92c0b99fba68116fd08a41887b60962c63a4330a72809ea2'
> Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' ..................................................
> Pulled run image 'paketobuildpacks/run@sha256:61a5832385b8cba83779eeb307d9014090702a23abd5e0b441c5590923c6e6ee'
> Executing lifecycle version v0.9.1
> Using build cache volume 'pack-cache-5cbe5692dbc4.build'
> Running creator
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Docker API call to 'localhost/v1.24/containers/ed99a4920b25eb3d56aae2626aeeac4e1aaac6f0df6faf8469645d7def5d8192/start' failed with status code 400 "Bad Request"
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
4 actionable tasks: 1 executed, 3 up-to-date
- Expected problem
-
builder and run images have been recently changed.
- working images
- builder: 'gcr.io/paketo-buildpacks/builder@sha256:4d77f1f574148ff8f6fcd6ada7bf16559aa9ab080c30cdfc6613cdb235c0fb3b'
-
run: 'gcr.io/paketo-buildpacks/run@sha256:1303a41dfeebb0450640655ad464c66af5c2a500e20ad86d5687f00c4805d971'
-
not working images
- builder: 'gcr.io/paketo-buildpacks/builder@sha256:14ddeb46d348e06c92c0b99fba68116fd08a41887b60962c63a4330a72809ea2'
- run: 'gcr.io/paketo-buildpacks/run@sha256:61a5832385b8cba83779eeb307d9014090702a23abd5e0b441c5590923c6e6ee'
Comment From: pdebicki
Same thing with Maven plugin:
[INFO] --- spring-boot-maven-plugin:2.3.3.RELEASE:build-image (default) @ charger ---
[INFO] Building image 'docker.io/nemesis/charger:2.0.10-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 100%
[INFO] > Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:14ddeb46d348e06c92c0b99fba68116fd08a41887b60962c63a4330a72809ea2'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:61a5832385b8cba83779eeb307d9014090702a23abd5e0b441c5590923c6e6ee'
[INFO] > Executing lifecycle version v0.9.1
[INFO] > Using build cache volume 'pack-cache-956a2375af0.build'
[INFO]
[INFO] > Running creator
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.432 s
[INFO] Finished at: 2020-08-19T18:38:08+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.3.RELEASE:build-image (default) on project charger: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.3.3.RELEASE:build-image failed: Docker API call to 'localhost/v1.24/containers/b715a79016ec5ed3d6b1dc87283a810261638c2f132f95c5483096801363e194/start' failed with status code 400 "Bad Request" -> [Help 1]
Comment From: lennybakkalian
We also had this problem. We used @virgo81net builder tag to fix it. Just execute:
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=<imageName> -Dspring-boot.build-image.builder=gcr.io/paketo-buildpacks/builder@sha256:4d77f1f574148ff8f6fcd6ada7bf16559aa9ab080c30cdfc6613cdb235c0fb3b
Comment From: virgo81net
For the gradle plugin, --builder option can be used to fix the problem.
./gradlew bootBuildImage --builder=gcr.io/paketo-buildpacks/builder@sha256:4d77f1f574148ff8f6fcd6ada7bf16559aa9ab080c30cdfc6613cdb235c0fb3b
Comment From: scottfrederick
I can re-create the problem also. It's likely an issue that Paketo needs to address in the builder. I'll ask them to investigate.
Comment From: scottfrederick
Here's what happened:
Spring Boot invokes lifecycle phases in the builder image using a path to executable binaries bundled in the image. The canonical path for lifecycle binaries per the CNB spec is /cnb/lifecycle
, but Boot is using an outdated path /lifecycle
. The pack
CLI that is used to create builder images symlinked /lifecycle
to /cnb/lifecycle
for backward compatibility.
The /lifecycle
symlink creation was removed from pack
in version 0.13.0
, and any builders that were created and published using this version of pack
became incompatible with Spring Boot.
The CNB team will release a 0.13.1
version of pack
that restores the /lifecycle
symlink in builders. The Paketo builders will be re-built so they include the /lifecycle
symlink.
We'll use this issue to update Spring Boot to use the canonical /cnb/lifecycle
path in future releases.
Comment From: virgo81net
spring boot 2.4.x also has the same problem.
Comment From: snicoll
@virgo81net thank you, the issue is outside of Spring Boot.
Comment From: scottfrederick
Paketo has published new builders (e.g. gcr.io/paketo-buildpacks/builder@sha256:793b289414f3ea66540750edf618756916b6102a6a94389822526cd99d033b36
) that have the /lifecycle
symlink restored, and are compatible with Spring Boot 2.3.x
and 2.4.0-Mx
releases.
Comment From: pradeepkk321
We also had this problem. We used @virgo81net builder tag to fix it. Just execute:
./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=<imageName> -Dspring-boot.build-image.builder=gcr.io/paketo-buildpacks/builder@sha256:4d77f1f574148ff8f6fcd6ada7bf16559aa9ab080c30cdfc6613cdb235c0fb3b
Where can we find all the available parameters we can pass into this goal??
Comment From: snicoll
@pradeepk-work this was over a year ago and both buildpacks and Spring Boot have evolved since. If you're having a question, please ask on StackOverflow. If you believe you've found an issue with Spring Boot, create a separate issue with a small sample we can run ourselves. Thank you.