gpt4 book ai didi

docker - 将gitlab设置为docker容器,并显示docker Registry错误500

转载 作者:行者123 更新时间:2023-12-02 21:26:09 32 4
gpt4 key购买 nike

我正在尝试在Vagrant框中运行Gitlab docker 容器。
但是我在运行Docker注册表时遇到一些问题。

我的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
要激活docker-registry,我将 /srv/gitlab/config/gitlab.rb更改为以下内容:
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之后,即可使用container-registry,但是单击按钮会将我发送到显示500错误页面的URL
http://192.168.7.7/mygroup/myproject/container_registry
并带有以下错误日志:
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"

有人知道这个问题吗?

最佳答案

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

gitlab:
[...]

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

关于docker - 将gitlab设置为docker容器,并显示docker Registry错误500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37925220/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com