/var/discourse 文件夹中的启动器命令并不自明

为了排查 Siteground 邮件服务的问题,我不得不多次更改并重新加载配置。关于如何最快速地完成此操作,网上有多种建议。
将所有这些建议汇总起来反而令人困惑。
因此,能否更详细地告诉我以下命令之间的区别?

安装指南 中的信息与本论坛中的帖子存在某些不一致之处。例如,初始化容器和构建容器之间的区别究竟为何,目前尚不完全清楚。
应该有一个“升级阶梯”,说明当您更改例如 app.yml 文件时,需要执行哪些操作以及对应哪些命令,因为有人称只需执行 start,而另一些人则称必须执行 rebuild 或同时执行 ./discourse-setup

命令:
    start:      启动/初始化容器
    stop:       停止正在运行的容器
    restart:    重启容器
    destroy:    停止并删除容器
    bootstrap:  基于模板为配置引导容器
    rebuild:    重建容器(销毁旧容器、引导、启动新容器)

我逐渐形成一种印象:所有命令都是按顺序执行的一系列操作。
每个后续步骤/命令都包含其前序步骤的功能,并额外增加了一些操作。

例如,类似如下:

  1. 启动流程

    1. bootstrap:销毁旧容器 + 基于模板为配置引导容器
    2. rebuild:执行 bootstrap + 重建容器(启动新容器),这意味着它会执行诸如下载最新版本的软件并应用更新后的配置等操作
    3. start:初始化(具体含义视情况而定)
  2. 停止流程

    1. stop:停止正在运行的容器
    2. restart:重启容器(包含停止操作)
    3. destroy:停止并删除容器
2 个赞

I am not sure I am following here… can you make a PR with your proposed change?

1 个赞

I going to do a PR on GitHub but I need to understand each command in detail what is currently not the case.

Could you tell me, what each command triggers? I’ve read many posts in this regard but the information is not consistence.
A good example is start. Once it is said it is just used to stop and start the container if e.g. doing something on the host. In another topic it is mentioned that it initializes a container, whatever initialize means :confused:

Initialize means that if no container exists it will be created. If you stop and start, you’ll stop and start the same container with the same parameters (like smtp and other env settings), but if you destroy first, a new container with new env settings will be created, or initialized.

1 个赞

what is the difference between bootstrap and start if no container exits?

Bootstrap builds a new docker image,which is necessary to be able to “initialize” a running container.

Rebuild will always work. Sometimes it’s unnecessary, as a destroy and start is enough to make env settings (like smtp) take effect. But lots of people won’t really understand these intricacies, so it’s better to just tell them to always rebuild because it always works.

3 个赞

so ./discourse-setup is the least invasive command as it only recreates discourse’s software.

  1. Bootstrap from very scratch, begins with docker image
  2. start, from scratch, builds a container
  3. ./discourse-setup, runs discourse’s setup

what command is available to reapply config as

  1. defined in app.yml?
  2. referenced in app.yml?

assuming app.yml is the source of anything, so ./discourse-setup reads only this file to do its job.

If you need to know what each command does exactly you can read it here: discourse_docker/launcher at master · discourse/discourse_docker · GitHub

3 个赞

thanks that helps :slight_smile:
There is once mentioned setup, is it related to ./discourse-setup?

1 个赞

现在内容更完整了:

用法:launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]
命令:
    start:       启动/初始化容器
    stop:        停止正在运行的容器
    restart:     重启容器
    destroy:     停止并移除容器
    enter:       打开一个 shell 在容器内运行命令
    logs:        查看容器的 Docker 日志
    bootstrap:   根据模板为配置引导容器
    run:         在最后一个引导的镜像的上下文中,使用配置运行给定命令
    rebuild:     重建容器(销毁旧的,引导,启动新的)
    cleanup:     移除所有已停止超过 24 小时的容器
    start-cmd:   生成用于启动容器的 docker 命令

选项:
    --skip-prereqs             不检查启动器先决条件
    --docker-args              运行 docker 时传递的额外参数
    --skip-mac-address         不分配 mac 地址
    --run-image                覆盖用于运行容器的镜像
root@monstera:/var/discourse# 
2 个赞

此主题已在 12 天后自动关闭。不再允许回复。