mint icon indicating copy to clipboard operation
mint copied to clipboard

Support --publish on debug command

Open sword-jin opened this issue 1 year ago • 3 comments

Expected Behavior

When we debug the container, we might need to connect the debugger by tcp

Actual Behavior


Steps to Reproduce the Problem


Specifications

  • Version:
  • Platform:

sword-jin avatar Apr 10 '24 05:04 sword-jin

Good idea :-) It's a relatively straight forward enhancement, so if you want to try adding it this could be a nice opportunity to contribute. If you don't have cycles at this point in time then I'll be able to add it in a week or so.

kcq avatar Apr 10 '24 06:04 kcq

The case is I want to generate a local port randomly, then use delve or gdb remote mode, listen this port on the debug container.

Then my vscode or something else can debug through this port.

I have no idea how to support this for all the platforms. The first case is k8s.

sword-jin avatar Apr 10 '24 07:04 sword-jin

The k8s runtime is a bit more involved compared to the other runtimes because it's using ephemeral containers and those don't support exposing ports. With k8s there'll need to be a port forwarder component that does the I/O through the standard I/O interface you get and then it would need to setup a local port listener on the client machine, so you'd connect to it with VSCode instead of connecting to the remote container. It's definitely doable, but it's a bit more work :-)

kcq avatar Apr 16 '24 20:04 kcq