We have recently started to use Gradle's bootBuildImage task for building docker images. Locally we can build images successfully without any issues, however our Jenkins build sometimes randomly fails with following error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':dockerTestImage:bootBuildImage'.
> Docker API call to 'localhost/v1.24/images/pack.local/builder/zuslfxipuv:latest?force=1' failed with status code 500 "Internal Server Error" and message "unrecognized image ID sha256:xxxxx"
Running the build again solves the issue. Has anyone faced the same issue?
Versions used in the project:
spring-boot version: 2.5.0
jdk version: 11
gradle version: 6