Skip to content

When the native Maven profile is enabled, configure build-image to build a native image #32764

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
snicoll opened this issue Oct 18, 2022 · 2 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Oct 18, 2022

This needs to be configured on the Maven side of things to build a native image properly with the default buildpacks:

<image>
  <builder>paketobuildpacks/builder:tiny</builder>
  <env>
    <BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
   </env>
</image>

For Gradle, it is:

tasks.named('bootBuildImage') {
  builder = 'paketobuildpacks/builder:tiny'
  environment = ['BP_NATIVE_IMAGE': 'true']
}

Maven could define this when the native profile is enabled. For Gradle, it could react to the fact that the NBT plugin is applied. In both cases, we need to be cautious about the environment and how users can override it if they wish to do so.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Oct 18, 2022
@snicoll snicoll added this to the 3.0.0-RC1 milestone Oct 18, 2022
@snicoll
Copy link
Member Author

snicoll commented Oct 18, 2022

The gradle side of things is tracked in #32768

@snicoll snicoll changed the title Configure Buildpacks for native image processing if necessary When the native Maven profile is enabled, configure build-image to build a native image Oct 18, 2022
@snicoll snicoll self-assigned this Oct 18, 2022
@snicoll
Copy link
Member Author

snicoll commented Oct 18, 2022

The override of the ENV or the base image works as expected. Adding more entries in ENV does not remove the one from the parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant