本文介绍了杀死一个Docker容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的节点应用程序设置了一个Docker容器并使用

I've set up a Docker container for my node app and ran it using

docker run -p 4500:4500 my_node_app

它以无守护进程模式启动了pm2. CTRL + C并退出不起作用.我试过docker在另一个终端窗口中停止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.

推荐答案

您将能够使用以下命令查看当前正在运行的Docker容器.

You will be able to see currently running docker containers using below command.

docker ps

然后复制正在运行的容器的容器ID,并执行以下命令

Then copy the CONTAINER ID of the running container and execute the following command

docker stop <container_id>

请替换为实际值.

这篇关于杀死一个Docker容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-29 05:09
查看更多