Docker 容器化应用拒绝停止。

huangapple go评论76阅读模式
英文:

Docker containarized application refuses to die

问题

我对Docker及其多个应用程序并不太熟悉。我使用以下命令来托管此Node.js应用程序

docker build -t quivero . && docker run --publish 8080:8080 quivero

这个命令按我们所希望的方式构建了应用程序,但我在停止它时遇到了问题。我尝试了通常的ctrl+Cctrl+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]

huangapple
  • 本文由 发表于 2023年1月8日 23:45:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75049135.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定