How to kill process inside container? Docker top command

后端 未结 4 1508
天涯浪人
天涯浪人 2021-02-02 09:36

I have simple example from official guide at docker website.

I run the following:

sudo docker run -d ubuntu:latest /bin/sh -c \"while true; do echo hello         


        
4条回答
  •  死守一世寂寞
    2021-02-02 10:31

    i was looking for something like this, but i couldn't find and then i did this:

    [root@notebook ~]# docker exec -it tadeu_debian ps aux | grep ping | awk '{ print $2 }' | xargs -I{} docker exec -i tadeu_debian kill -9

    It was two "execs" from Docker e one xargs.

    Well, i hope this helps someone!

提交回复
热议问题