Reputation: 3756
I am starting a docker container from a subprocess.Popen and it works, but when the script returns, the terminal settings of my shell are messed up. Nothing is echoed. I can fix this with tset
in the terminal, but I don't want to require that. Has anyone here worked with docker and had seen and solved this issue?
Here is how I am starting the container:
cmd = ['sudo',
'docker',
'run',
'-t',
'-i',
'elucidbio/capdata:v2',
'bash'
]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
I have tried replacing the bash with an infinite loop and using nohup
, but the same thing happened.
Upvotes: 4
Views: 526
Reputation: 3756
I fixed this by removing -t and passing in stdin=None. This was suggested by J.F. Sebastian in a comment, and he did not want to post it as an answer, so I am.
Upvotes: 4