0

我有一个docker container正在运行的gitlab community edition.

它工作正常,只是容器仍然存在unhealthty

问题来自/opt/gitlab/etc/gitlab-healthcheck-rc文件。它包含url='http://localhost:80/gitlab/help'并且应该是url='http://myhostname:80/gitlab/help'

如果我改变它,它的工作。但是每次有 agitlab-ctl reconfigure时,它都会返回localhost

确实,在日志中我可以看到

  * template[/opt/gitlab/etc/gitlab-healthcheck-rc] action create
    - update content in file /opt/gitlab/etc/gitlab-healthcheck-rc from 1e4e16 to 1a5b11

但从哪里来localhost?有没有办法以正确的值启动容器?

我在其中添加了一个hostname: myhostnamedocker-compose.yml但它不起作用。

4

1 回答 1

1

您可以更改/opt/gitlab/embedded/cookbooks/gitlab/recipes/gitlab-healthcheck.rb它,好像启用了 nginx 似乎 localhost 是硬编码的

if node['gitlab']['nginx']['enable']
  ...
  host = "localhost:#{node['gitlab']['nginx']['listen_port']}"
end
于 2019-09-11T13:17:58.323 回答