Debugging Docker-Compose Connecting Issues - Need to Press F5 2x #3253
Replies: 2 comments
-
I agree--if I had to guess, the Surprisingly I don't see a timeout option on the Python attach configuration. @int19h any ideas what to do here? |
Beta Was this translation helpful? Give feedback.
-
We generally try to avoid polling/retries and provide a way to indicate readiness instead. In this case, if it's possible to use "listen" and |
Beta Was this translation helpful? Give feedback.
-
I followed the instructions in: #1765 to get VsCode debugger to attach to my docker-compose project.
I use
command": "docker-compose up -d' with the
-dflag within
tasks.json, and then reference this task within
launch.jsonas a
preLaunchTask`.It generally works, but there's a slight minor annoyance in that I actually have to press F5 twice to run the process twice.
The first time I press it, it seems to spool up the container in the background, but somehow the debugger isn't able to connect, and it gets stuck. I've set it to wait for the debugger so nothing happens.
Then, I have to press F5 again, It re-executes the above task, and then the debugger is able to connect.
Some other observations:
(1) If I remove the
-d
background flag fromdocker compose
then this run-twice workaround doesn't work.(2) I can of course execute
docker compose -f docker-compose.debug.yml up
manually, and then run the debugger (after removing the prelaunchTask). But this is two steps and makes fast debugging slow.Any idea what I'm doing here? It would seem that if I applied some time-out before the debugger tried to connect, which gave enough time for the Docker Container to spin up, would do the job. That is my working hypothesis at the moment.
Beta Was this translation helpful? Give feedback.
All reactions