# 在拥有良好/就绪镜像的情况下无需重建进行升级？

**URL:** <https://meta.discourse.org/t/upgrade-without-rebuilding-having-a-good-ready-image/389235>\
**Category:** Product Support\
**Created:** [2025 年11 月 20 日 15:03 UTC](https://meta.discourse.org/t/upgrade-without-rebuilding-having-a-good-ready-image/389235 "2025-11-20T15:03:57Z")\
**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)\
发布日期： [2025 年11 月 20 日 15:15 UTC](https://meta.discourse.org/t/upgrade-without-rebuilding-having-a-good-ready-image/389235/2 "2025-11-20T15:15:24Z")

</div>

您可以构建一个镜像，将其推送到仓库，然后使用 `./launcher start-cmd app` 启动它，以获取启动容器的 docker 命令（但您需要将您的容器仓库替换为本地仓库）。

然而，之后您还需要迁移数据库、预编译资产等等。

如果您想避免停机时间，双容器设置允许您在旧容器继续运行时构建一个新容器，然后它会处理迁移之类的内容。

如果您想格外小心，可以在 `app.yml` 中设置 `SKIP_POST_DEPLOYMENT_MIGRATIONS`，然后在启动新容器后执行 `rake db:ensure_post_migrations db:migrate`。不执行此操作可能会迁移数据库，导致旧容器无法再使用它。这通常不是问题，而且持续时间不长。

---

_[View the full topic](https://meta.discourse.org/t/upgrade-without-rebuilding-having-a-good-ready-image/389235)._
