# 无法停止容器

**URL:** https://meta.discourse.org/t/cant-stop-container/38832
**Category:** Support
**Created:** [2016年二月1日 15:01 UTC](https://meta.discourse.org/t/cant-stop-container/38832 "2016-02-01T15:01:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [2016年二月1日 15:01 UTC](https://meta.discourse.org/t/cant-stop-container/38832/1 "2016-02-01T15:01:44Z")

</div>

``  
Stopping old container

- /usr/bin/docker stop -t 10 app  
``  
This takes forever, any ideas how to solve it?  
I tried to restart the docker service & Physical Server but I still can’t stop the container.

I just find this:  
Continuing the discussion from [Runsv hanging on Docker container shutdown](https://meta.discourse.org/t/runsv-hanging-on-docker-container-shutdown/36844/53):

> [@sam](#):
>
> New image is out now and will resolve this issue.

but, if I can’t stop old container how can I rebuild with the new image?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [2016年二月1日 15:16 UTC](https://meta.discourse.org/t/cant-stop-container/38832/2 "2016-02-01T15:16:58Z")

</div>

Reboot your machine so Discourse is running normally.

Run `docker ps` to get the container ID. If there are multiple, you need to find the right one. Then, run `docker kill <id>` to kill the container. While stopping is broken, killing works – so violence _does_ help here 🙂

Then, simply rebuild as usual.

---

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [2016年二月1日 15:24 UTC](https://meta.discourse.org/t/cant-stop-container/38832/3 "2016-02-01T15:24:09Z")

</div>

> [@fefrei](#):
>
> run docker kill \<id\> to kill the container

thanks, but,  
docker kill also takes forever… 😕

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [2016年二月1日 15:27 UTC](https://meta.discourse.org/t/cant-stop-container/38832/4 "2016-02-01T15:27:01Z")

</div>

Hm, then I’m out of ideas.

Are you certain you rebooted your server beforehand? Any try to stop the container will most likely leave it unstoppable and needing 100% CPU. Killing only worked for me while the container was running normally.

---

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [2016年二月1日 15:31 UTC](https://meta.discourse.org/t/cant-stop-container/38832/5 "2016-02-01T15:31:08Z")

</div>

> [@fefrei](#):
>
> Killing only worked for me while the container was running normally.

thanks, I restarted my Physical Server, than worked!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2024年六月8日 12:45 UTC](https://meta.discourse.org/t/cant-stop-container/38832/6 "2024-06-08T12:45:55Z")

</div>

此主题已在 3049 天后自动关闭。不再允许回复。
