Make pdb work with docker

I am trying to get pdb while working with docker

We just started using docker in development. I am running python scripts inside docker

I can attach to docker container:

 docker exec  -ti 6e2355917804  /bin/bash 

I can infer

 docker attach 6e2355917804

I read this , but I do not use fig.

I see that the code hits the breakpoint, but I cannot interact with the PDB.

Docker version 1.7.1,

+4
source share
2 answers

I did not use the -i flag when starting my original docker container. Be sure to use

docker run -it <job>
+2
source

If you are using docker layout, you need to do the following.

Step 1. Add the following to your yml file:

stdin_open: true
tty: true

stdin. -it.

2.

docker attach <generated_instance_id>

pdb

+2

Source: https://habr.com/ru/post/1605984/


All Articles