# 使用 Dockerfile 安装 Discourse

**URL:** https://meta.discourse.org/t/install-discourse-with-dockerfile/122694
**Category:** Support
**Tags:** unsupported-install
**Created:** [2019年七月11日 18:10 UTC](https://meta.discourse.org/t/install-discourse-with-dockerfile/122694 "2019-07-11T18:10:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dgateles](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dgateles/32/74776_2.png) [@dgateles](https://meta.discourse.org/u/dgateles)
#### Post date: [2019年七月11日 18:10 UTC](https://meta.discourse.org/t/install-discourse-with-dockerfile/122694/1 "2019-07-11T18:10:18Z")

</div>

是否可以在 Jenkins 中配置 Dockerfile，将 Discourse 安装在 Docker 容器中？

如下所示：

```docker
RUN mkdir -p /mnt/discourse
RUN git clone https://github.com/discourse/discourse_docker.git /mnt/discourse
RUN cd /mnt/discourse
COPY app.yml /mnt/discourse/containers/
CMD ["./launcher", "bootstrap", "app"]
CMD ["./launcher", "start", "app"]

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年七月11日 20:15 UTC](https://meta.discourse.org/t/install-discourse-with-dockerfile/122694/2 "2019-07-11T20:15:03Z")

</div>

有可能，大概吧。容易吗？不。

我认为你需要为此构建一个自定义镜像。参见 [https://meta.discourse.org/t/can-discourse-ship-frequent-docker-images-that-do-not-need-to-be-bootstrapped/33205。](https://meta.discourse.org/t/can-discourse-ship-frequent-docker-images-that-do-not-need-to-be-bootstrapped/33205%E3%80%82)

你可以考虑运行 bootstrap 命令，它会创建你所需的 Docker 镜像，然后使用适当的环境变量设置启动它。

但如果你希望在这里获得支持，就需要使用 `./launcher` 来构建并运行该镜像。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019年八月10日 20:15 UTC](https://meta.discourse.org/t/install-discourse-with-dockerfile/122694/3 "2019-08-10T20:15:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
