gitlab – 注册表选项卡不起作用

我在AWS服务器上安装了gitlab,它按预期工作.

http://ec2-54-167-34-63.compute-1.amazonaws.com/

但是,当我点击“注册表”标签时,我显示页面未找到错误(500)

/etc/gitlab/gitlab.rb的相关部分

gitlab_rails['gitlab_default_projects_features_container_registry'] = true

# registry_external_url 'https://registry.gitlab.example.com'
registry_external_url 'http://ec2-54-167-34-63.compute-1.amazonaws.com:4567'

# Settings used by GitLab application
gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "http://ec2-54-167-34-63.compute-1.amazonaws.com"
gitlab_rails['registry_port'] = "5005"
gitlab_rails['registry_api_url'] = "http://localhost:5000"
gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"

# Settings used by Registry application
registry['enable'] = true
registry['username'] = "registry"
registry['group'] = "registry"
registry['uid'] = nil
registry['gid'] = nil
registry['dir'] = "/var/opt/gitlab/registry"
registry['log_directory'] = "/var/log/gitlab/registry"
registry['log_level'] = "info"
registry['rootcertbundle'] = "/var/opt/gitlab/registry/certificate.crt"
registry['storage_delete_enabled'] = true

更新

根据下面的日志,我需要gitlab-registry.key文件在正确的位置.这是什么文件,如何生成?

tail /var/log/gitlab/gitlab-rails/production.log

Started GET "/root/test/container_registry" for 125.99.49.46 at 2016-10-24 08:29:27 +0000
Processing by Projects::ContainerRegistryController#index as HTML
  Parameters: {"namespace_id"=>"root", "project_id"=>"test"}
Completed 500 Internal Server Error in 23ms (ActiveRecord: 3.5ms)

Errno::ENOENT (No such file or directory @ rb_sysopen - /var/opt/gitlab/gitlab-rails/etc/gitlab-registry.key):
  lib/json_web_token/rsa_token.rb:20:in `read'
  lib/json_web_token/rsa_token.rb:20:in `key_data'
  lib/json_web_token/rsa_token.rb:24:in `key'
  lib/json_web_token/rsa_token.rb:28:in `public_key'
  lib/json_web_token/rsa_token.rb:33:in `kid'
  lib/json_web_token/rsa_token.rb:12:in `encoded'
  app/services/auth/container_registry_authentication_service.rb:30:in `full_access_token'
  app/models/project.rb:421:in `container_registry_repository'
  app/controllers/projects/container_registry_controller.rb:28:in `container_registry_repository'
  app/controllers/projects/container_registry_controller.rb:8:in `index'
  lib/gitlab/request_profiler/middleware.rb:15:in `call'
  lib/gitlab/middleware/go.rb:16:in `call'

更新2

我想我需要生成证书,如此处所解释的……

http://www.bonusbits.com/wiki/HowTo:Setup_HTTPS_for_Gitlab

最佳答案 检查GitLab服务器日志(因为它是错误500.此类日志的示例:
issue 23019)

GitLab 8.13:23575: No way to enable container registry存在待解决的问题,合并请求为7037: Fix typo in project settings that prevents users from enabling container registry.
它们可能与您的问题有关.

Issue 23339还提到“整理自签名证书问题(我的注册表与gitlab本身在不同的域下)”:这不应该是这里的情况.

Issue 23181(推送到注册表仍然经常遭遇未经授权:需要身份验证)表明错误消失了docker 1.11(因此它取决于您在AWS上使用的docker版本)

关于OP编辑提到的gitlab-registry.key,如果声明正确,应该通过简单的重新配置来创建.

所以仔细检查:

> 1316

It turns out it was a typo on my part.
The config key is registry_nginx["ssl_certificate"] not registry_nginx[ssl_certificate].

> 1218merge request 3787显示了如何添加此功能.

点赞