- Question When executing spring-boot:build-image, the docker server downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve this problem?
- Exception
Comment From: scottfrederick
Spring Boot does not download the JRE when building an image. It invokes the Paketo CNB builder and buildpacks, and the buildpacks download any artifacts required for the image. You can view the Paketo documentation for details on how to customize the buildpack behavior. There is a section in the documentation that discusses techniques for configuring alternative download locations.
Comment From: JamesTaylor04
Thanks, Mr scottfrederick! According to your suggestion, I have solved the problem, and I provide the solution below and hope this will give others a little help. There are two ways to resolve the problem: - Firstly, also the simplest way, is to upgrade your spring-boot-maven-plugin, make sure >= version 2.5.0 here I use version 2.6.0 then, you have to reference the section in the documentation
- provide the configuration in your project root directory
the type file's content is
the sha256 file's content is your custom url of JRE
-
copy platform directory to your docker host, and put it in your custom location, here I put it in /home/ws/pack/
-
in your maven pom file, put this code into image element of spring-boot-maven-plugin's configuration element
-
now, execute mvn:package goal, and you will find this log below
-
Secondly, also the complicated way, is to create your own buildpack and use it, you can have a try