elixir-ls
elixir-ls copied to clipboard
Debug elixir application running in Docker container?
Environment
- Elixir version: 1.11.2
- Operating system: Windows10 / WSL2 with Ubuntu
- Editor or IDE name: VSCode
Question
Is any way to debug elixir application running in docker container? I'm comming from JVM world where debugging is just run application in debug mode with some port and expose that port from docker. Then can attach to process in container and debug with code on local OS.
That's not supported.
Currently elixir-ls debugger needs to execute the debugged app directly. To do it in docker it would need to run inside the container as well. I think that with a bit of tinkering you could modify the vscode extension to run your container with debugger.sh process instead of running it directly.
There are some other ideas https://github.com/elixir-lsp/vscode-elixir-ls/issues/47 that may help.
@lukaszsamson i obviously know nothing about ElixirLS and the debugger - buuut, I have extensive experience with other languages and their debuggers, all of which allow for remote debugging over an exposed port. If that is something that is possible, it would be a TREMENDEOUS step up in our developer experience, and would single handedly solve issues like these.
@kuchtakamil If you are using VsCode, you can run a remote instance from within the container, and THEN run the code directly from the ElixirLS plugin. Thats how i use all my languages nowadays ;)
@markomitranic Could you please explain the VSCode workflow you describe here?
Thanks
@markomitranic Could you please explain the VSCode workflow you describe here?
Thanks
Here @christo-ph https://medium.com/homullus/remote-development-or-how-i-learned-to-stop-worrying-and-love-the-mainframe-90165147a57d
Have in mind that remote development takes time/patience to get used to. Luckily, all of the tooling works like a charm. :)
I'm going to close that as there is no consensus on how to approach that