多容器设置中启动器更新如何工作?

你好,前面有一大段文字,请耐心阅读,我只是出于好奇。

我是双容器用户:data 和 web_only。

为了更新,我 SSH 登录到服务器,然后我原以为只需输入:

sh /var/discourse/launcher bootstrap web_only
sh /var/discourse/launcher stop web_only
sh /var/discourse/launcher start web_only

但这样做的问题是,在启动后,仍然运行的是旧版本,而不是更新后的版本。为什么会这样?

实际上,为了完成更新,我必须运行:

sh /var/discourse/launcher bootstrap web_only
sh /var/discourse/launcher stop web_only
sh /var/discourse/launcher destroy web_only     // 这一步也是必须的
sh /var/discourse/launcher start web_only

我的第二个问题是:为什么 destroy 命令不会同时删除我刚刚通过 bootstrap 创建的新镜像?

另一个有趣的观察:我注意到在 bootstrap 过程中,会创建并删除多个不同的容器。

能否请您稍微(再多一点?)解释一下 launcher 的工作原理以及它做了哪些“巧妙”的操作?

提前感谢。

Because “stop” just stops the current running container. You need to also remove it so you launch the new container you built.

“destroy” will destroy containers, not images. In docker speak this is the difference between rm and rmi

Bootstrap creates an “image”

Start will use the “image” to create a “container”

4 个赞

*only if a container doesn’t exist. If the container exists, then it will use the same one (even though it is not from the latest image). ← Is that correct?

yes, that is correct. If the container exists already it will not create a new one.

1 个赞

Thanks for all the answers.

Do you think this post could be material for a howto post?

I think the knowledge should probably integrated into an existing howto about multi container setup.

1 个赞

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