Killing a process in a container to launch dockers

I have a server application running in a Docker container. One of the processes in it hung and should be killed (the application will then create another process to replace it).

Is there a way to kill this process without stopping the Docker container?

+4
source share
5 answers

This is not possible at the moment with Docker, but it seems to be planned at 0.8, see question No. 1228 here .

However, you can use lxc-attach to launch the shell in an existing container (see the comments on the problem above), and you can then kill your freezing process:

 $ lxc-attach -n FULLCONTAINERID /bin/bash
+2
source

FULLCONTAINERID ps --no-trunc = true:

root @turmes/home/zoobab [35] # docker ps --no-trunc = true > C 2741d88a51148e66d7b2b44d8c1cc6ed7d1515f370be5d00bd003d40cf8d575b zoobab/centos57: kamailio -P/var/run/kamailio.pid -m 64 -M 4 -u kamailio -g kamailio -D 1 Up 19 minutes angry_fermat
root @turmes/home/zoobab [36] #

+1

Docker 1.3, exec:

docker exec container_name kill process_name
+1

Docker 1.3 , Docker, nsenter.

.

, , .

+1

times may have changed, but with docker.latest: docker kill 593690fe0087killed CONTAINER IDwhen I started docker ps. I had a container for 2 weeks, and I saw it only now, when the environment was not.

0
source

All Articles