Skip to content

Add buildpack option for image building #21722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scottfrederick opened this issue Jun 5, 2020 · 5 comments
Closed

Add buildpack option for image building #21722

scottfrederick opened this issue Jun 5, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@scottfrederick
Copy link
Contributor

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.

@scottfrederick scottfrederick added this to the 2.4.x milestone Jun 5, 2020
@dogilvie
Copy link

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.

@eddumelendez
Copy link
Contributor

eddumelendez commented Aug 17, 2020

@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

@dogilvie
Copy link

dogilvie commented Aug 17, 2020

@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>

@snicoll
Copy link
Member

snicoll commented Aug 18, 2020

@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.

@scottfrederick
Copy link
Contributor Author

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>]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants