英文:
Docker containarized application refuses to die
问题
我对Docker及其多个应用程序并不太熟悉。我使用以下命令来托管此Node.js应用程序:
docker build -t quivero . && docker run --publish 8080:8080 quivero
这个命令按我们所希望的方式构建了应用程序,但我在停止它时遇到了问题。我尝试了通常的ctrl+C
或ctrl+Z
。我还尝试了sudo docker kill $CONTAINER_ID
,但出现了以下错误:
Error response from daemon: Cannot kill container: $CONTAINER_ID: permission denied
在我看来,docker compose up
更受欢迎。你认为呢?
英文:
I am not very familiar to docker and its multiple applications. I use it to host this NodeJS application by run of below command:
docker build -t quivero . && docker run --publish 8080:8080 quivero
It builds the application as we wish, but I have trouble to bring it down. I tried the usual ctrl+C
or ctrl+Z
. I tried as well sudo docker kill $CONTAINER_ID
Error response from daemon: Cannot kill container: $CONTAINER_ID: permission denied
It seems to me docker compose up
is rather preferred. What do you think?
答案1
得分: 1
你可以使用以下命令来查看正在运行的容器:
docker ps
然后,如果你想停止容器,你需要输入以下命令:
docker stop [容器名称]
所以对于你的情况,可以输入以下命令来停止容器:
docker stop quivero
如果你需要删除已经停止的容器,你可以输入以下命令:
docker rm [容器名称]
英文:
You can check running containers with command
docker ps
Then if you want to stop the container you need to write
docker stop [container name]
so for you
docker stop quivero
if you need to remove stopped container you can write
docker rm [container name]
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论