feat(boil): Support for per-image build arguments - #1603
Merged
Conversation
dervoeti
self-requested a review
August 18, 2026 14:11
dervoeti
requested changes
Aug 18, 2026
Member
There was a problem hiding this comment.
This feature currently doesn't allow overwriting the value on a per version level.
We need this to be in this PR I'd say because currently overwriting makes the build fail:
head -n13 opa/boil-config.toml
[metadata.registries]
"oci.stackable.tech" = { namespace = "sdp" }
[build-arguments]
golang-version = "9.9.9"
# Version 1.12.3
[versions."1.12.3".local-images]
stackable-devel = "1.0.0"
vector = "0.55.0"
[versions."1.12.3".build-arguments]
golang-version = "1.26.0"
cargo boil build opa=1.12.3
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
Running `target/debug/boil build opa=1.12.3`
[+] Building 0.0s (1/1) FINISHED docker:default
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 4.64kB 0.0s
-.json:1
--------------------
1 | >>>
--------------------
ERROR: -.json:1,987-1003: Duplicate object attribute; An attribute named "GOLANG_VERSION" was already defined at -.json:1,961-977.
Error: failed to run build command
Which is probably even better than silently ignoring it, but I would still include that functionality in this PR already.
Cool feature though, makes the boil configs more readable 🙂
This improves and simplifies the build argument internals by using a BTreeMap instead of a BTreeSet. Keys and values are now properly separated and thus a map can be used with all the obvious benefits. These benefits include automatic de-duplication of keys allowing overrides at different levels of hierarchy (eg. per-image shared build arguments vs per-version ones). It additionally removes wrapper code which was only needed to forward implementations of the inner type through the newtype.
Member
Author
Your wish has been granted in 1b0ce2d :) |
Co-authored-by: Lukas Krug <lukas.voetmand@stackable.tech>
dervoeti
previously approved these changes
Aug 18, 2026
dervoeti
left a comment
Member
There was a problem hiding this comment.
Change itself LGTM, two optional things:
- Update README.md
- The build arguments in the global config (src/config.rs) should probably get
#[serde(default, deserialize_with = "docker::deserialize_args")]as well
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed in #1600 that we need to copy+paste many build arguments (with the same value) across versions of the same image in the
boil-configfiles. In order to make this easier, it is now possible to specify a shared list of build arguments which apply to all versions of a single image.The arguments can be overwritten on a per-version basis if needed.