Kill a Docker Container

Coder_Nick picture Coder_Nick · Jun 25, 2018 · Viewed 17k times · Source

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.

Answer

srimaln91 picture srimaln91 · Jun 25, 2018

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.