I start a container with name pg.I wanted to debug a bash script in a container, so I installed bashdb in the container. I started it:
root@f8693085f270:/# /usr/share/bin/bashdb docker-entrypoint.sh postgres
I go back to the host, and do:
[eric@almond volume]$ docker exec -ti pg bash
root@f8693085f270:/# ps ajxw
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    0     1     1     1 ?         3746 Ss       0   0:00 bash
    1  3746  3746     1 console   3746 S+       0   0:00 /bin/bash 
[eric@almond postgres]$ ps ajxw | grep docker
30613  3702  3702 30613 pts/36    3702 Sl+   1000   0:01 docker run --name pg -v /home/eric/tmp/bashdb:/bashdb -it postgres bash
 3760  8049  8049  3760 pts/19    8049 S+       0   0:00 /bin/bash /usr/share/bin/bashdb docker-entrypoint.sh postgres
 4166  8294  8294  4166 pts/9     8294 Sl+   1000   0:00 docker exec -ti pg bash
So in the container I see a TTY entry console, which I have never seen before, and I see the debugging entry in ps on the host! 
What is going on?