I am trying to get pdb working with docker
We have just started using docker in development. I run python scripts inside docker
I can attach to a docker container:
docker exec -ti 6e2355917804 /bin/bash
I can tail the output
docker attach 6e2355917804
I've read this but I'm not using fig.
I can see the code hit the breakpoint but I can't interact with PDB.
Docker version 1.7.1,
In case you are using docker compose, you need to do the following.
Step 1. Add the following in your yml file
stdin_open: true
tty: true
This will enable interactive mode and will attach stdin. This is equivalent for -it mode.
Step 2.
docker attach <generated_instance_id>
You'll now get the pdb shell
I wasn't using the -i flag when launching my original docker container. Make sure to use
docker run -it <job>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With