2016-11-25 136 views
0

我已经运行与码头工人注册表泊坞窗上example.domain.com与搬运工人注册表错误设置gitlab 500

docker run -d -p 5000:5000 --restart=always --name registry \ 
-v /etc/ssl/certs/:/certs \ 
-e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/registry \ 
-v /git/docker_registry:/var/lib/registry \ 
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/server.crt \ 
-e REGISTRY_HTTP_TLS_KEY=/certs/server.key \ 
registry:2 

我可以推拉这个搬运工注册表,但是当我试图把它与它在同一运行gitlab连接机example.domain.com使用gitlab.yml配置:

registry: 
    enabled: true 
    host: example.domain.com 
    port: 5005 
    api_url: http://localhost:5000/ 
    key: /etc/ssl/certs/server.key 
    path: /git/docker_registry 

在网页浏览器中启用项目码头工人登记工作正常,但是当我去项目页面和开放Regisry page我得到错误500

Gitlab日志显示:

Started POST "/api/v3/internal/allowed" for 10.10.200.96 at 2016-11-25 10:15:01 +0100 
Started POST "/api/v3/internal/allowed" for 10.10.200.96 at 2016-11-25 10:15:01 +0100 
Started POST "/api/v3/internal/allowed" for 10.10.200.96 at 2016-11-25 10:15:01 +0100 
Started GET "/data-access-servicess/centipede-rest/container_registry" for 10.11.0.232 at 2016-11-25 10:15:01 +0100 
Processing by Projects::ContainerRegistryController#index as HTML 
    Parameters: {"namespace_id"=>"data-access-servicess", "project_id"=>"centipede-rest"} 
Completed 500 Internal Server Error in 195ms (ActiveRecord: 25.9ms) 

Faraday::ConnectionFailed (wrong status line: "\x15\x03\x01\x00\x02\x02"): 
    lib/container_registry/client.rb:19:in `repository_tags' 
    lib/container_registry/repository.rb:22:in `manifest' 
    lib/container_registry/repository.rb:31:in `tags' 
    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' 

和码头工人登记日志:

2016/11/25 09:15:01 http: TLS handshake error from 172.17.0.1:44608: tls: first record does not look like a TLS handshake 
+0

您是否在注册表前配置了nginx反向代理,详细说明如下:https://gitlab.com/help/administration/container_registry.md config:https:// gitlab。 com/gitlab -org/gitlab-ce/blob/master/lib/support/nginx/registry-ssl – jaxxstorm

+0

不幸的是,我们使用Gitlab Bitnami堆栈并运行Apache。这是我完全失去了,因为配置nginx(它应该运行gitlab或它的只是代理注册表?) – Martin

回答

0

的问题是,gitlab尝试通过HTTP和HTTPS无法连接到注册表中。因此你得到了TLS握手错误。

如果您使用的是自签名证书从

registry: 
    api_url: http://localhost:5000/ 

更改gitlab config来

registry: 
    api_url: https://localhost:5000/ 

,不要忘了信任它在安装gitlab在机器上。请参阅 - >https://docs.docker.com/registry/insecure/#troubleshooting-insecure-registry