Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (12.7k points)
I am using docker to run a python script that uses subprocess module to run some commands in terminal ,

After Running the script using docker, if i use ctrl+c or kill command to kill the the process , in my terminal process is getting killed, but process continue to run in background and create logs as well.

I tried running the script directly in my system , and it works fine and after killing it just stop, but when i ran using docker it continue to run in background even after kill -9 process_id.

sample code to simulate the issue.

1 Answer

0 votes
by (12.4k points)

Get docker process with 

ps -ef | grep docker 

then run

$ docker kill <PID>

Are you interested in knowing more about DevOps and its Tools? Come & join: DevOps Certification

Want to learn more about Docker, check out: 

Browse Categories

...