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
When I reproduce your situation I see different PIDs between docker top
and docker exec -it
. When you do docker exec
the command is executed inside the container => should use container's pid. Otherwise you could do the kill without docker straight from the host, in your case: sudo kill -9 25055
.