# 从 discourse/discourse 构建 Discourse 镜像 - 如何安装插件

**URL:** <https://meta.discourse.org/t/building-discourse-image-from-discourse-discourse-how-to-install-plugins/394969>\
**Category:** Self-hosting\
**Tags:** docker, install, hosting\
**Created:** [2026年二月2日 18:10 UTC](https://meta.discourse.org/t/building-discourse-image-from-discourse-discourse-how-to-install-plugins/394969 "2026-02-02T18:10:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevejr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevejr/32/292622_2.png) [@stevejr](https://meta.discourse.org/u/stevejr)\
**Post date:** [2026年二月3日 08:33 UTC](https://meta.discourse.org/t/building-discourse-image-from-discourse-discourse-how-to-install-plugins/394969/3 "2026-02-03T08:33:58Z")

</div>

非常感谢以上信息。

所以，我们希望在 Kubernetes 集群中运行 Discourse，并希望能够在 CI/CD 工作流程中构建镜像，因此需要自定义 Dockerfile。所有环境变量随后都通过 ConfigMap 和/或 Secret 提供给正在运行的 Pod。我知道这不是受支持的安装方式，但我们至少想使用受支持的方式来构建特定版本的 Discourse 镜像，以便我们可以控制更新时间。

查看现有的 `launcher` 脚本和 `samples/web_only.yml`，我认为可以注释掉 `volumes` 和 `links` 部分，因为这些将在 Kubernetes 中使用持久卷 (Persistent Volume) 和挂载来完成。然后，我们会在 `web_only.yml` 中添加固定的环境变量值，使用 bootstrap 命令构建容器，然后将生成的镜像复制到我们自己的仓库中。

对于 Discourse 版本，我们可以监控 Docker Hub 上何时有新版本发布，然后修改 `web.template.yml` 文件中的 `base_image` 值。

这样听起来正确吗？

---

_[View the full topic](https://meta.discourse.org/t/building-discourse-image-from-discourse-discourse-how-to-install-plugins/394969)._
