Skip to content

Commit be5d66a

Browse files
zakkakgsmet
authored andcommitted
Pass container-runtime-options to native-image --version as well
`quarkus.native.container-runtime-options` should be respected when invoking the builder image to get its version. Closes: #45842 (cherry picked from commit 726ba17)
1 parent c1d35cc commit be5d66a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,16 @@ private void pull(String effectiveBuilderImage, boolean processInheritIODisabled
119119

120120
@Override
121121
protected String[] getGraalVMVersionCommand(List<String> args) {
122-
return buildCommand("run", Collections.singletonList("--rm"), args);
122+
List<String> containerRuntimeArgs;
123+
if (nativeConfig.containerRuntimeOptions().isPresent()) {
124+
List<String> runtimeOptions = nativeConfig.containerRuntimeOptions().get();
125+
containerRuntimeArgs = new ArrayList<>(runtimeOptions.size() + 1);
126+
containerRuntimeArgs.addAll(runtimeOptions);
127+
containerRuntimeArgs.add("--rm");
128+
} else {
129+
containerRuntimeArgs = Collections.singletonList("--rm");
130+
}
131+
return buildCommand("run", containerRuntimeArgs, args);
123132
}
124133

125134
@Override

0 commit comments

Comments
 (0)