# 按照插件安装的标准指示操作后，重建容器一直失败

**URL:** <https://meta.discourse.org/t/rebuilding-the-container-is-constantly-failing-after-following-the-standard-instructions-on-plugin-install/304406>\
**Category:** Self-hosting\
**Created:** [2024 年4 月 18 日 04:53 UTC](https://meta.discourse.org/t/rebuilding-the-container-is-constantly-failing-after-following-the-standard-instructions-on-plugin-install/304406 "2024-04-18T04:53:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![Denis\_Didkovsky](https://avatars.discourse-cdn.com/v4/letter/d/53a042/32.png) [@Denis\_Didkovsky](https://meta.discourse.org/u/Denis_Didkovsky)\
发布日期： [2024 年4 月 18 日 04:53 UTC](https://meta.discourse.org/t/rebuilding-the-container-is-constantly-failing-after-following-the-standard-instructions-on-plugin-install/304406/1 "2024-04-18T04:53:26Z")

</div>

我们正在 DO 上运行 Discourse 的标准安装。一切都很好。然后我们决定按照此链接添加一个插件：

> [@在自托管网站上安装插件](https://meta.discourse.org/t/install-plugins-in-discourse/19157):
>
> warning 本指南假设您已进行了自托管标准安装。我们仅在此处支持标准的安装方法，因此这些说明假定您已完成标准安装。 warning 本指南仅适用于自托管 Discourse 实例。如果您使用的是托管服务，可用插件由您的托管服务提供商控制。例如，在我们的托管服务上，[这些特定的插件](https://www.discourse.org/plugins)按托管层级提供。 information_source 截至 2025 年中期，[许多流行的官方插件已捆绑到 Discourse 核心中](https://meta.discourse.org/t/373574)。这些插件（包括 Solved、[Data Explorer](https://meta.discourse.org/t/32566?silent=true)、AI、Assign、Reactions 等）不再需要单独安装——它们随 Discourse 一起提供，可以通过站点设置启用。如果您尝试使用仍位于 app.yml 中的捆绑插件进行重建，您将看到一条 HINT 消息提示您将其删除。本指南适用于未与核心捆绑的插件。 在本教程中，我们将安装 [Discourse Shared Edits](https://meta.discourse.org/t/discourse-shared-edits/167583?tl=en) 插件。 本教程要求了解如何使用 GitHub 仓库，特别是[如何获取或复制 git clone URL](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) 以及如何使用 nano 通过终端编辑 YAML (\*.ym…

通过添加以下行：

```plaintext
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git

```

容器重建失败。

```FAILED
--------------------
Pups::ExecError: echo "End of custom commands failed with return #<Process::Status: pid 5121 exit 2>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params "echo \"End of custom commands"
bootstrap failed with exit code 2

```

所有命令都以 root 身份运行。我认为问题出在这里：

```plaintext
I, [2024-04-18T04:28:49.985355 #1] INFO -- : > cd /var/www/discourse/plugins && sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git && sudo -E -u discourse git clone https://github.com/discourse/discourse-templates.git
Cloning into 'docker_manager'...
warning: unable to access '/root/.config/git/attributes': Permission denied
Cloning into 'discourse-templates'...
warning: unable to access '/root/.config/git/attributes': Permission denied

```

请在此处提供建议。

---

_[View the full topic](https://meta.discourse.org/t/rebuilding-the-container-is-constantly-failing-after-following-the-standard-instructions-on-plugin-install/304406)._
