I've set up a Docker container for my node app and ran it using
docker run -p 4500:4500 my_node_app
It launched pm2 in no-daemon mode. CTRL+C and exit don't work. I've tried docker stop my_node_app in another terminal window but to no avail. Appreciate any help.
Kill All Containers Using Docker Compose If you do, killing multiple containers takes one command: docker-compose down. You could also run docker-compose without detached mode. If so, you'll just use ^C to kill all containers. And there you have it—all containers killed!
docker rm -f The final option for stopping a running container is to use the --force or -f flag in conjunction with the docker rm command. Typically, docker rm is used to remove an already stopped container, but the use of the -f flag will cause it to first issue a SIGKILL.
Run YouTrack docker container Note that pressing `Ctrl+C` when the terminal is attached to a container output causes the container to shut down.
docker container kill $(docker ps -q) — Kill all running containers. Then you delete the container with: docker container rm my_container — Delete one or more containers. docker container rm $(docker ps -a -q) — Delete all containers that are not running.
You will be able to see currently running docker containers using below command.
docker ps
Then copy the CONTAINER ID of the running container and execute the following command
docker stop <container_id>
Please replace with a real value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With