hhajhh 发表于 2018-1-11 12:36:24

Omnibus Gitlab安装container registry报错

  按照http://docs.gitlab.com/ce/administration/container_registry.html#container-registry-domain-configuration
  官方文档配置gitlab.rb,结果报错:
  Recipe: gitlab::default
  * directory action create (up to date)
  ================================================================================
  Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
  ================================================================================
  NoMethodError
  -------------
  undefined method `[]=' for nil:NilClass
  Cookbook Trace:
  ---------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:35:in `from_file'

  >  ----------------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:
  28:    group "root"
  29:    mode "0775"
  30:    action :nothing
  31:end.run_action(:create)
  32:
  33:Gitlab[:node] = node
  34:if File.exists?("/etc/gitlab/gitlab.rb")
  35>>   Gitlab.from_file("/etc/gitlab/gitlab.rb")
  36:end
  37:node.consume_attributes(Gitlab.generate_config(node['fqdn']))
  38:
  39:if File.exists?("/var/opt/gitlab/bootstrapped")
  40:          node.set['gitlab']['bootstrap']['enable'] = false
  41:end
  42:
  43:directory "/var/opt/gitlab" do
  44:    owner "root"
  Running handlers:
ERROR: Running exception handlers
  Running handlers complete
ERROR: Exception handlers complete
  Chef Client failed. 0 resources updated in 01 seconds
FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
ERROR: undefined method `[]=' for nil:NilClass
FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
  原因:
  gitlab版本太低!!不支持container registry。
  gitlab-ce从8.8开始支持container registry:
  https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4040
  查看gitlab版本:
  https://gityu.com/help
  升级gitlab-ce:
  sudo yum install gitlab-ce
  https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/update/README.md#updating-using-the-official-repositories
  使用yum info gitlab-ce查看版本,如果依然低于最新版本;
  更新cache:
  yum makecache fast
  参照https://packages.gitlab.com/gitlab/gitlab-ce/install 使用rpm下面的
  

curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash  

  更新repository
  此时yum info gitlab-ce查看到版本已更新:
https://images2015.cnblogs.com/blog/334237/201608/334237-20160808133506731-79684459.png
  最后
  sudo yum install gitlab-ce
  安装最新版本。
页: [1]
查看完整版本: Omnibus Gitlab安装container registry报错