将gitlab设置为具有Docker注册表的Docker容器,显示错误500 [英] setting up gitlab as docker container with docker registry showing error 500

查看:113
本文介绍了将gitlab设置为具有Docker注册表的Docker容器,显示错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在流浪者框中运行Gitlab泊坞窗容器。
但是我在运行docker注册表时遇到一些问题。

I'm trying to running a Gitlab docker container in a Vagrant box. But I have some problems getting the docker registry running.

我的 docker-compose.yml

gitlab:
  container_name: gitlab
  image: gitlab/gitlab-ce:latest
  volumes:
  - /srv/gitlab/config:/etc/gitlab
  - /srv/gitlab/logs:/var/log/gitlab 
  - /srv/gitlab/data:/var/opt/gitlab
  - /srv/gitlab/logs/reconfigure:/var/log/gitlab/reconfigure
  restart: always
  hostname: 192.168.7.7
  ports:
    - 0.0.0.0:23:22
    - 0.0.0.0:80:80
    - 0.0.0.0:443:443
    - 0.0.0.0:5000:5000
    - 0.0.0.0:7443:7443

(端口23:22只是因为我是在无业游民中启动的

gitlab本身以后可以在IP下使用: 192.168.7.7

(port 23:22 is only because I start it in a vagrant box and the port is already used)
the gitlab itself is later available under the ip: 192.168.7.7

要激活docker-registry,我将 /srv/gitlab/config/gitlab.rb 更改为以下内容:

To activate the docker-registry I changed the /srv/gitlab/config/gitlab.rb to the following:

gitlab_rails['registry_enabled'] = true
gitlab_rails['registry_host'] = "192.168.7.7"
gitlab_rails['registry_port'] = "7443"
gitlab_rails['registry_api_url'] = "http://192.168.7.7:5000"

在新的docker-compose之后,容器注册表可用向上,但是单击该按钮会将我发送到显示500错误页面的URL。

http://192.168.7.7/mygroup/myproject/container_registry

并显示以下错误日志:

The container-registry is available after a new docker-compose up, but clicking on the button is sending me to the URL showing me a 500 error page
http://192.168.7.7/mygroup/myproject/container_registry
and with this error log:

gitlab    | 
gitlab    | ==> /var/log/gitlab/gitlab-rails/production.log <==
gitlab    | Started GET "/mygroup/myproject/container_registry" for 127.0.0.1 at 2016-06-20 14:29:06 +0000
gitlab    | Processing by Projects::ContainerRegistryController#index as HTML
gitlab    |   Parameters: {"namespace_id"=>"plattform", "project_id"=>"node-sample"}
gitlab    | Completed 500 Internal Server Error in 858ms (ActiveRecord: 29.6ms)
gitlab    | 
gitlab    | Faraday::ConnectionFailed (Connection reset by peer):
gitlab    |   lib/container_registry/client.rb:18:in `repository_tags'
gitlab    |   lib/container_registry/repository.rb:22:in `manifest'
gitlab    |   lib/container_registry/repository.rb:31:in `tags'
gitlab    |   app/controllers/projects/container_registry_controller.rb:8:in `index'
gitlab    |   lib/gitlab/middleware/go.rb:16:in `call'
gitlab    | 
gitlab    | 
gitlab    | 
gitlab    | ==> /var/log/gitlab/gitlab-workhorse/current <==
gitlab    | 2016-06-20_14:29:07.96418 2016/06/20 14:29:07 ErrorPage: serving predefined error page: 500
gitlab    | 
gitlab    | ==> /var/log/gitlab/nginx/gitlab_access.log <==
gitlab    | 192.168.7.1 - - [20/Jun/2016:14:29:07 +0000] "GET /mygroup/myproject/container_registry HTTP/1.1" 500 2205 "http://192.168.7.7/mygroup/myproject" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
gitlab    | 
gitlab    | ==> /var/log/gitlab/gitlab-workhorse/current <==
gitlab    | 2016-06-20_14:29:07.96500 192.168.7.7 @ - - [2016-06-20 14:29:06.832069994 +0000 UTC] "GET /mygroup/myproject/container_registry HTTP/1.1" 500 2205 "http://192.168.7.7/mygroup/myproject" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" 1.132525
gitlab    | 
gitlab    | ==> /var/log/gitlab/gitlab-rails/production.log <==
gitlab    | Started GET "/mygroup/myproject/container_registry" for 127.0.0.1 at 2016-06-20 14:29:07 +0000
gitlab    | Processing by Projects::ContainerRegistryController#index as HTML
gitlab    |   Parameters: {"namespace_id"=>"plattform", "project_id"=>"node-sample"}
gitlab    | Completed 500 Internal Server Error in 98ms (ActiveRecord: 10.6ms)
gitlab    | 
gitlab    | Faraday::ConnectionFailed (Connection reset by peer):
gitlab    |   lib/container_registry/client.rb:18:in `repository_tags'
gitlab    |   lib/container_registry/repository.rb:22:in `manifest'
gitlab    |   lib/container_registry/repository.rb:31:in `tags'
gitlab    |   app/controllers/projects/container_registry_controller.rb:8:in `index'
gitlab    |   lib/gitlab/middleware/go.rb:16:in `call'
gitlab    | 
gitlab    | 
gitlab    | 
gitlab    | ==> /var/log/gitlab/gitlab-workhorse/current <==
gitlab    | 2016-06-20_14:29:08.13700 2016/06/20 14:29:08 ErrorPage: serving predefined error page: 500
gitlab    | 2016-06-20_14:29:08.13719 192.168.7.7 @ - - [2016-06-20 14:29:07.985360314 +0000 UTC] "GET /mygroup/myproject/container_registry HTTP/1.1" 500 2205 "http://192.168.7.7/mygroup/myproject" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0" 0.151699
gitlab    | 
gitlab    | ==> /var/log/gitlab/nginx/gitlab_access.log <==
gitlab    | 192.168.7.1 - - [20/Jun/2016:14:29:08 +0000] "GET /mygroup/myproject/container_registry HTTP/1.1" 500 2205 "http://192.168.7.7/mygroup/myproject" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"

任何人知道这个问题吗?

Anyone knows this problem?

推荐答案

实际的注册表未包含在Gitlab中,它仅用作身份验证服务。
您将需要为注册表设置一个单独的容器:

The actual Registry is not included in Gitlab, it only serves as an authentication service. You will need to setup a separate container for the registry:

gitlab:
  [...]

registry:
  image: registry:2
  [...]

这篇关于将gitlab设置为具有Docker注册表的Docker容器,显示错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆