mint
mint copied to clipboard
Support --publish on debug command
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:
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.
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.
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 :-)