This is an automated email from the ASF dual-hosted git repository.

tkobayas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new aff6059224c [incubator-kie-tools#4095] Fix Podman compatibility in 
native image builds (#4096)
aff6059224c is described below

commit aff6059224cbabd933bb9dc5d879e76ac610332a
Author: Toshiya Kobayashi <[email protected]>
AuthorDate: Tue Dec 1 09:55:27 2026 +0900

    [incubator-kie-tools#4095] Fix Podman compatibility in native image builds 
(#4096)
    
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
 packages/image-builder/src/bin.ts | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/packages/image-builder/src/bin.ts 
b/packages/image-builder/src/bin.ts
index 89e67190fea..73e398b64db 100644
--- a/packages/image-builder/src/bin.ts
+++ b/packages/image-builder/src/bin.ts
@@ -92,6 +92,15 @@ function createAndUseDockerBuilder(args: { 
allowHostNetworkAccess: boolean; useD
   }
 }
 
+function isPodman(engine: string): boolean {
+  try {
+    const output = execSync(`${engine} --version`, { stdio: "pipe" 
}).toString();
+    return output.toLowerCase().includes("podman");
+  } catch {
+    return false;
+  }
+}
+
 function checkBuildEngine(args: ArgsType) {
   try {
     execSync(`command ${process.platform === "win32" ? "" : "-v"} 
${args.engine}`, {
@@ -129,10 +138,11 @@ function buildArchImage(args: ArgsType & { arch: string[] 
| undefined }, imageFu
 
 function buildNativeImage(args: ArgsType, imageFullNames: string[]) {
   console.log(`[image-builder] Building native image`);
+  const useDockerFlags = !isPodman(args.engine);
   const buildNativeCommand = `${args.engine} build
     --progress=plain
-    --load
-    ${args.allowHostNetworkAccess ? "--allow network.host --network host" : ""}
+    ${useDockerFlags ? "--load" : ""}
+    ${args.allowHostNetworkAccess ? (useDockerFlags ? "--allow network.host 
--network host" : "--network host") : ""}
     ${args.push ? "--push" : ""}
     ${imageFullNames.map((fullName) => `-t ${fullName}`).join(" ")}
     ${args.buildArg.map((arg) => `--build-arg ${arg}`).join(" ")}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to