diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index e8185521e7f90..fa5a73abc7727 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -606,8 +606,15 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES); } if (nativeConfig.debugBuildProcess) { + String debugBuildProcessHost; + if (isContainerBuild) { + debugBuildProcessHost = "0.0.0.0"; + } else { + debugBuildProcessHost = "localhost"; + } nativeImageArgs - .add("-J-Xrunjdwp:transport=dt_socket,address=" + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y"); + .add("-J-Xrunjdwp:transport=dt_socket,address=" + debugBuildProcessHost + ":" + + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y"); } if (nativeConfig.enableReports) { nativeImageArgs.add("-H:+PrintAnalysisCallTree");