-
Notifications
You must be signed in to change notification settings - Fork 522
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
[Codespaces] Python Debugging for single Dockerfiles does not work in VS Codespaces #2565
Comments
Thanks @ucheNkadiCode! Let's explore if we can avoid the volume mapping for Python by installing the debugger directly into the container. @bwateratmsft feel free to steal this from me if necessary |
We can, but it carries the risk of incompatibilities with the Python extension. Since we need volume mappings for .NET debugging to work, IMO it's simpler if we just require the same for Python. |
Additionally: either it would have to be in the Dockerfile (not pretty), or it would have to be done on the running container, which would add a small amount of time to the inner loop. Not a lot, debugpy is small, but some. |
This is also covered by #2389, but I'll leave this issue open; we plan to copy in debugpy in the short term so we'll use this to track that. |
We talked about this yesterday in a meeting, but we realized that volume mapping is probably not the only problem for Python. The debugging flow involves starting a debugpy server on the host machine, and starting a debugpy client within the container. That client is given information on how to connect back to the server. Generally this is done through the host gateway (Linux), or just simply 'localhost' (Mac, Win), but I doubt this will work in Codespaces' Docker-beside-Docker scenario. |
I'm going to move this to 1.10.0, with the ongoing work to set up Codespaces for Docker-in-Docker now is not a good time to try to make big changes. |
This works now with Codespaces' Docker-in-Docker setup! No work needed from us. |
After creating a working repo for a Python application in VS Codespaces.
When you run the command Docker: Add files to workspace, I selecting Python: Django with all of the defaults. This created a launch configuration named Docker: Python - Django. Unfortunately, upon F5 there seemed to be some sort of failure in Volume Mapping the debugger. Maybe there is an issue with the scaffolding of the launch configuration.
Workaround: In order to debug I had to create a Python: Remote Attach configuration in
launch.json
. I then ran the command Docker: Add Compose Files, ran compose up on a container, then attached to to the running container.I would like to be able to debug my Python application in a container with only a Dockerfile.
The text was updated successfully, but these errors were encountered: