Unable to run debug code inside container #3750
Replies: 2 comments 8 replies
-
Are you using our dev container support to develop within the container, or are you explicitly trying to do a remote attach to the debugger running within the container? If you do the former then there's no need to open any ports as VS Code will be running inside the container itself (and will launch the container so VS Code can connect to it). |
Beta Was this translation helpful? Give feedback.
-
I'm not sure where this
I see an error after the Does the "Python Debug Console" open? Looks like this:
For Python debugging, we start |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a python project, running inside a docker, that I'm to debug using VScode, but couldn't (after reading the documentation: setup and debug)
I create a Hello World project to share my problems here.
This is the script 'hw.py':
After creating this file and open the folder in VSCode, I ran "Docker: Add Docker Files to workspace", which created the expected files (
tasks.json
,lauch.json
,Dockerfile
andrequirements.txt
).However, when I go to "Run and Debug" and try to debug the new "Docker: Python - General" I get the following message:
I try the several options, without success.
If I try to launch the debugger again, the message no longer appears, but I see this in the output:
And nothing happens (the code does not run).
I also noticed that the created Dockerfile has no exposed port. How is the debugger supposed to communicate with VSCode?
Dockerfile:
What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions