• 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

SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

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

  1. provide the configuration in your project root directory

SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

the type file's content is

SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

the sha256 file's content is your custom url of JRE

SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

  1. copy platform directory to your docker host, and put it in your custom location, here I put it in /home/ws/pack/ SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

  2. in your maven pom file, put this code into image element of spring-boot-maven-plugin's configuration element SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

  3. now, execute mvn:package goal, and you will find this log below SpringBoot spring-boot:build-image downloads BellSoft Liberica JRE 8.0.312 so slowly, how to resolve it?

  4. Secondly, also the complicated way, is to create your own buildpack and use it, you can have a try