Just try this way no need to pass container in the cmd
docker kill my_container
If above doesn't work then pass the time parameter as below
docker stop ----time=30 my_container
When you issue a docker stop command Docker will first ask nicely for the process to stop and if it doesn't comply within 10 seconds it will forcibly kill it. If you've ever issued a docker stop and had to wait 10 seconds for the command to return you've seen this in action
The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process (PID 1) in the container. If the process hasn't exited within the timeout period a SIGKILL signal will be sent.
Whereas a process can choose to ignore a SIGTERM, a SIGKILL goes straight to the kernel which will terminate the process. The process never even gets to see the signal.
When using docker stop the only thing you can control is the number of seconds that the Docker daemon will wait before sending the SIGKILL
Just try this way no need to pass container in the cmd
docker kill my_container
If above doesn't work then pass the time parameter as below
docker stop ----time=30 my_container
When you issue a docker stop command Docker will first ask nicely for the process to stop and if it doesn't comply within 10 seconds it will forcibly kill it. If you've ever issued a docker stop and had to wait 10 seconds for the command to return you've seen this in action
The docker stop command attempts to stop a running container first by sending a SIGTERM signal to the root process (PID 1) in the container. If the process hasn't exited within the timeout period a SIGKILL signal will be sent.
Whereas a process can choose to ignore a SIGTERM, a SIGKILL goes straight to the kernel which will terminate the process. The process never even gets to see the signal. When using docker stop the only thing you can control is the number of seconds that the Docker daemon will wait before sending the SIGKILL