Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill a running process like a webserver inside a Docker container without killing the container

Tags:

docker

i want to kill a running process like a Django webserver inside a Docker container without killing the container itself but for some reason if i do docker exec -it <container> ps -aux and then docker exec <container> kill <pid> it will kill my docker instance and i don't want that.

How can i address this issue?

like image 782
psychok7 Avatar asked Aug 26 '15 10:08

psychok7


1 Answers

you can go: docker exec -it <container> bash once inside the container you can then kill <pid>. This will kill the process but keep the container running unless this is the process the container was started with.

like image 146
GHETTO.CHiLD Avatar answered Oct 09 '22 00:10

GHETTO.CHiLD