启动器重建后未显示任何内容

我正在尝试按照指南,通过教程 Use an import script that requires MySQL - #4 by pfaffman 为应用容器添加对 MySQL gem 的支持。

但是,当我运行以下命令时,它只是卡住了。

> ./launcher stop app
> ./launcher rebuild import

image
直到我用 CTRL+C 终止该进程。

注意: 我已经等待了几个小时,希望看到任何响应,但没有任何反应。

当我检查 Docker 容器时,它显示了一个新的(损坏的)已停止容器。

image

我不确定自己做错了什么,导致了这种行为。

我的 containers/import.yml 文件内容(已省略未修改的部分):

服务器托管在 DO 上,当我重启 Docker 服务时,它会恢复为原始的运行中的应用容器。

image

附注: ./launcher rebuild app 可以正常工作。

在尝试构建 import 之前,也许可以先运行 ./launcher stop app;

编辑:

真倒霉。

是的,显然我是在执行 stop 子命令之后运行 rebuild 的。让我来编辑我的问题。

好的,我明白了。在我停止容器

> ./launcher stop app

之后,我还删除了容器 docker rm app,然后尝试重新构建,这次构建继续进行了。

现在,当它使用 mysql-dep 模板时,出现了以下错误。

...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-4) ...
Setting up nettle-dev:amd64 (3.4.1-1) ...
Setting up libgnutls28-dev:amd64 (3.6.7-4+deb10u2) ...
Setting up libmariadb-dev (1:10.3.22-0+deb10u1) ...
Processing triggers for libc-bin (2.28-10) ...

I, [2020-02-27T16:51:33.937186 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'
[DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'test development'`, and stop using this flag
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /var/www/discourse/Gemfile freeze 
by running `bundle config unset deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* mysql2
I, [2020-02-27T16:51:34.670930 #1]  INFO -- : 
I, [2020-02-27T16:51:34.672542 #1]  INFO -- : Terminating async processes
I, [2020-02-27T16:51:34.673101 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 49
I, [2020-02-27T16:51:34.673593 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 166
2020-02-27 16:51:34.674 UTC [49] LOG:  received fast shutdown request
166:signal-handler (1582822294) Received SIGTERM scheduling shutdown...
2020-02-27 16:51:34.682 UTC [49] LOG:  aborting any active transactions
166:M 27 Feb 2020 16:51:34.693 # User requested shutdown...
166:M 27 Feb 2020 16:51:34.695 * Saving the final RDB snapshot before exiting.
2020-02-27 16:51:34.698 UTC [49] LOG:  worker process: logical replication launcher (PID 58) exited with exit code 1
2020-02-27 16:51:34.701 UTC [53] LOG:  shutting down
166:M 27 Feb 2020 16:51:34.741 * DB saved on disk
166:M 27 Feb 2020 16:51:34.742 # Redis is now ready to exit, bye bye...
2020-02-27 16:51:34.786 UTC [49] LOG:  database system is shut down


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development' failed with return #<Process::Status: pid 970 exit 16>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["echo \"gem 'mysql2'\" >> Gemfile", "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y libmariadb-dev", "su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without test development'"]}
75b27d60e1dc3a4b5d76bc75f2874ebf405fe29edfebec3cb809233f7b01ec48
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.

有人知道这个错误是怎么回事吗?

我遇到了类似的问题。这似乎与 Failed to bootstrap using import template 相同。

我本意是不尝试升级该容器,因为我已经看到了这个问题,但由于另一个奇怪的错误,我还是试了一下……

编辑:我在模板中

su discourse -c 'bundle config unset deployment'

这一行之前添加了

 su discourse -c 'bundle install --no-deployment --path vendor/bundle --jobs 4 --without "test development"'

现在可以正常工作了。(不过,唉,这并没有解决我那个无关的问题)。

我上周刚用过这个模板,一切正常。这有点奇怪,但下周值得再看一眼。我会把它加入我的清单。

我也是!不过我猜是不是有什么升级了?

除了评论之外,我还必须跳过启动器的前置条件

> ./launcher rebuild import --skip-prereqs

并遵循 @pfaffman 的建议

镜像构建成功。:white_check_mark:

看起来这里已经解决了——@pfaffman @rahilqf 能确认一下吗?

看起来是这样。非常感谢!

要是现在有个能自动添加 php-serialize 的模板就好了……