# 空间不足时升级：停止应用，然后清理，然后重建应用？

**URL:** <https://meta.discourse.org/t/upgrading-when-space-seems-low-stop-app-then-cleanup-then-rebuild-app/293627>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [2024 年1 月 31 日 13:01 UTC](https://meta.discourse.org/t/upgrading-when-space-seems-low-stop-app-then-cleanup-then-rebuild-app/293627 "2024-01-31T13:01:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

作者： ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
发布日期： [2024 年1 月 31 日 14:50 UTC](https://meta.discourse.org/t/upgrading-when-space-seems-low-stop-app-then-cleanup-then-rebuild-app/293627/2 "2024-01-31T14:50:49Z")

</div>

docker 在构建容器时会创建大量文件（包括它构建的容器）。当你构建一个新容器时，你仍然拥有旧容器（以及磁盘映像）。这就是清理时会删除的内容。

在 discourse 运行时执行清理命令会稍微安全一些，因为清理命令不会删除正在运行的容器。如果重建出现问题，你仍然可以重新启动旧容器（如果它存在）。

因此，我会删除上面第 (1) 步，而第 (3) 步是不必要的，因为 `./launcher` 会执行拉取（以前它不会）。

---

_[View the full topic](https://meta.discourse.org/t/upgrading-when-space-seems-low-stop-app-then-cleanup-then-rebuild-app/293627)._
