The pack
CLI build
command supports a buildpack
option that allows the user to customize the list of buildpacks used to build the image. Buildpack references are supported in the form of <buildpack>@<version>
, path to a buildpack directory, path/URL to a buildpack .tar or .tgz file, or the name of a buildpack image packaged in the builder.
This option could be useful to users of the Spring Boot Maven plugin spring-boot:build-image
goal and Gradle plugin bootBuildImage
task.
Comment From: dogilvie
We would like to use this feature to be able to select the JVM chosen. Currently the built image selects Bellsoft Liberica and this cannot be modified.
Comment From: eddumelendez
@dogilvie the workaround for 2.3 can be pack build hello-pedestal \
--builder "gcr.io/paketo-buildpacks/builder:base" \
--buildpack gcr.io/paketo-buildpacks/amazon-corretto
or any other jdk available
Comment From: dogilvie
@dogilvie the workaround for 2.3 can be
pack build hello-pedestal \ --builder "gcr.io/paketo-buildpacks/builder:base" \ --buildpack gcr.io/paketo-buildpacks/amazon-corretto
or any other jdk available
How do I utilize this in the context of spring boot? Our image is built using the spring-boot-maven-plugin
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
Comment From: snicoll
@dogilvie this feature is not implemented yet so you'll have to create your own builder in the meantime (as @eddumelendez mentioned) and use your custom builder rather than the default. Doing so is explained in the documentation (for instance here for Maven). If you have more questions, please follow-up on StackOverflow.
Comment From: scottfrederick
The pack
CLI supports several options for referencing the source of a buildpack. Of these options, the following will be supported by the Boot plugins in the initial feature implementation:
- CNB builder resource -
[urn:cnb:builder:]<id>[@<version>]
- File system directory -
[file://]<path>
- File system gzipped tar file -
[file://]<path>/<file name>
- OCI image -
[docker://]<image name>[:<tag>|@<digest>]
The remaining options can be implemented as demand dictates:
- Downloaded gzipped tar file -
http[s]://<host>/<path>
- CNB registry resource -
urn:cnb:registry:<id>[@<version>]