Skip to content

Add bindings command-line option for build-image goal - #50889

Open
TYsewyn wants to merge 1 commit into
spring-projects:mainfrom
TYsewyn:build-image-bindings-property
Open

Add bindings command-line option for build-image goal#50889
TYsewyn wants to merge 1 commit into
spring-projects:mainfrom
TYsewyn:build-image-bindings-property

Conversation

@TYsewyn

@TYsewyn TYsewyn commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
  • Allowed volume bind mounts to be supplied through the spring-boot.build-image.bindings and --bindings properties
  • Added command-line bindings to those configured in pom.xml or the Gradle build script, taking precedence over a configured one when they share the same container destination path

- Allowed volume bind mounts to be supplied through the
  `spring-boot.build-image.bindings` and `--bindings` properties
- Added command-line bindings to those configured in `pom.xml` or
  the Gradle build script, taking precedence over a configured
  one when they share the same container destination path

Signed-off-by: Tim Ysewyn <Tim.Ysewyn@me.com>
@TYsewyn
TYsewyn force-pushed the build-image-bindings-property branch from 65f86d3 to c11edda Compare June 29, 2026 18:25
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 29, 2026
@snicoll

snicoll commented Jul 28, 2026

Copy link
Copy Markdown
Member

@TYsewyn thanks for the PR. On the the top of my head, I am not aware of a commad lline option that would be additive. In Maven, in particular, this feels like an anti-pattern to me. If you provide a property on the command line, its purpose is to override the default. If you really want to add, then the method should be named differenty but it's a bit at odd with maven again.

Can you review the above and clarify the intent?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jul 28, 2026
@TYsewyn

TYsewyn commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @snicoll! The intent is to add more, or override, Buildpacks bindings from the CLI.
Some of the bindings in our CI environment are dynamic and we can't define them in our Maven or Gradle configuration.
As an alternative we could change --bindings to take precedence over what has been configured, and add --add-binding (repeatable) to be additive to what's already configured in the build scripts. The additional binding passed as CLI argument would then take precedence over what's already defined.

For Maven I'd then split this into spring-boot.build-image.bindings (the full override) and spring-boot.build-image.additional-bindings (the additions, comma separated, taking precedence over what's defined in pom.xml)

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Aug 12, 2026
@snicoll

snicoll commented Aug 12, 2026

Copy link
Copy Markdown
Member

Some of the bindings in our CI environment are dynamic and we can't define them in our Maven or Gradle configuration.

You don't need an additional property for that, do you? If you expose the original property, you can then manipulate any way you like in your project. I am not keen to have a addBindings feature and/or property for that reason. Can you amend your PR to expose the property?

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants