Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --publish on debug command #14

Open
sword-jin opened this issue Apr 10, 2024 · 3 comments
Open

Support --publish on debug command #14

sword-jin opened this issue Apr 10, 2024 · 3 comments
Labels

Comments

@sword-jin
Copy link
Contributor

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:
@kcq
Copy link
Contributor

kcq commented Apr 10, 2024

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.

@sword-jin
Copy link
Contributor Author

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.

@kcq kcq added the WIP label Apr 14, 2024
@kcq
Copy link
Contributor

kcq commented Apr 16, 2024

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants