-
Notifications
You must be signed in to change notification settings - Fork 1.4k
<platform> configuration should be configurable with system properties #2742
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
Comments
Any progress on this? I like to decouple the choice of platform from my app. |
If your main goal is to decouple the platform settings, then for now, you can easily parameterize them through Maven properties with default values. |
Hey, thanks for your reply! I use parameterization for most settings, however for the deeply nested platform settings like 'architecture' and 'os', I can't get it to work. In my example below I'll show you what works and what doesn't. POM settings that work well: <from>
<image>arm32v7/adoptopenjdk:11-jre-hotspot</image>
<platforms>
<platform>
<architecture>arm</architecture>
<os>linux</os>
</platform>
</platforms>
</from> Above settings replaced by parameters in mvn command: Maybe I got the explanation in the docs wrong --> (i.e. -Djib.parameterName[.nestedParameter.[...]]=value), any ideas? |
@LeaTaka so what I was talking about as a workaround was to use standard Maven features to accomplish the same effect of using the built-in Jib system and Maven properties. For the built-in Jib properties, our code reads system and Maven properties like this, but as you observed, this isn't defined for the <properties>
<!-- Define Maven properties. These are arbitrary Maven properties, so you can name them however you want. -->
<jib.platform-arch>amd64</jib.platform-arch> <!-- most likely the default value you want to use -->
<jib.platform-os>linux</jib.platform-os>
</properties>
...
<!-- Jib configuration -->
<from>
<image>arm32v7/adoptopenjdk:11-jre-hotspot</image>
<platforms>
<platform>
<architecture>${jib.platform-arch}</architecture>
<os>${jib.platform-os}</os>
</platform>
</platforms>
</from> Then, when you run Jib, by default the platform will be
|
How to set up multiple platforms?
|
@StringKe it's a list property. For example, |
For example,
-Djib.from.platforms=... list of platforms ...
.Note that
architecture
andos
are required sub-properties. Need to think about the format. Also consider #2471.The text was updated successfully, but these errors were encountered: