- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在使用 traefik作为反向代理(以及用于管理letsencrypt证书),我正在运行一个自托管的gitlab实例。 GitLab 镜像是一个整体,其中包含所有服务,两个服务(Registry 和 Git)都需要在同一个容器中提供。
通过如下所示的配置,gitlab 运行良好。
docker login registry.domain.com
也在工作。
但是在 gitlab 前端导航到注册表会给我一个 500 错误。
gitlab 日志:
Errno::EADDRNOTAVAIL (Failed to open TCP connection to localhost:5000 (Cannot assign requested address - connect(2) for "localhost" port 5000)):
在我阅读的文档中,5000 端口是 gitlab 注册表的默认端口。
于是我进入了 gitlab 容器,尝试调用 localhost:5000:
$ docker exec -it gitlab /bin/bash
root@gitlab:/# curl -v http://localhost:5000
* Rebuilt URL to: http://localhost:5000/
* Trying 127.0.0.1...
* TCP_NODELAY set
* connect to 127.0.0.1 port 5000 failed: Connection refused
* Trying ::1...
* TCP_NODELAY set
* Immediate connect fail for ::1: Cannot assign requested address
* Trying ::1...
* TCP_NODELAY set
* Immediate connect fail for ::1: Cannot assign requested address
* Failed to connect to localhost port 5000: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 5000: Connection refused
而且没有5000...
root@gitlab:/# netstat -tanpu | grep -i listen
tcp 0 0 127.0.0.1:9093 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.11:33383 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9229 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 638/nginx
tcp 0 0 127.0.0.1:8082 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9236 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 21/sshd
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 638/nginx
tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN -
tcp6 0 0 :::9094 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN 21/sshd
那么我的配置中缺少什么? traefik 中的 5000 端口如何处理?
docker-compose.yml
version: '3.3'
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url = 'https://gitlab.domain.com'
registry_external_url = 'https://registry.domain.com'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
gitlab_rails['registry_enabled'] = true
ports:
- '2222:22'
networks:
- proxy
labels:
- traefik.enable=true
- traefik.gitlab.frontend.rule=Host:gitlab.domain.com
- traefik.gitlab.port=80
- traefik.reg.frontend.rule=Host:registry.domain.com
- traefik.reg.port=80
- traefik.docker.network=proxy
traefik:
image: traefik:1.7.3-alpine
restart: always
ports:
- 80:80
- 443:443
networks:
- proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
labels:
- traefik.frontend.rule=Host:monitor.domain.com
- traefik.port=8080
container_name: traefik
networks:
proxy:
external: true
traefik.toml
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.dashboard]
address = ":8080"
[entryPoints.dashboard.auth]
[entryPoints.dashboard.auth.basic]
users = ["admin:password"]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[api]
entrypoint="dashboard"
[docker]
domain = "domain.com"
watch = true
network = "proxy"
[acme]
email = "notifications@domain.com"
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"
最佳答案
首先:阅读“GitLab Container Registry administration ”,确保:
The container registry works under HTTPS by default. Using HTTP is possible but not recommended and out of the scope of this document. Read Test an insecure registry.
第二,关于traefik ,您可以在 docker-gitlab issue 1688 中查看示例,它确实向 GitLab 的注册表部分声明了一个 traefik 前端。
- traefik.enable=true
- traefik.backend=registry.demo.com
- traefik.frontend.rule=Host:registry.demo.com
- traefik.docker.network=traefik-00
- traefik.port=5000
如果您确实需要通过带有 traefik 的外部 http URL 公开您的内部“https 端口 5000”注册表,您在 this thread 中有一个示例.
关于docker - 自托管 Gitlab 注册表 : Connection refused for localhost:5000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52934012/
我有一些关于 Gitlab Server 和 Gitlab Runner 的问题。 必须安装 GitLab Runner 才能执行 CI/CD 部署吗? 必须为 GitLab Runner 安装 Gi
我正在docker上运行gitlab/gitlab-ce容器。然后,在其中,我想通过提供docker作为运行器来运行gitlab-runner服务。而我运行的每个命令(例如docker ps,dock
刚刚在全新的高性能服务器上安装了全新的 6.8 Gitlab。 在考虑忘记我的存储库历史记录(评论、问题等...)之前,有人知道一种将存储库数据从 Gitlab 服务器导出到另一个 Gitlab 服务
我读了这篇比较 https://about.gitlab.com/pricing/self-managed/feature-comparison/在 Gitlab 上,很多事情还不清楚。我想问一下在某
我的配置文件: external_url "http://192.168.3.23" # note the use of a dotted ip gitlab_rails['gitlab_email
GitLab 支持多种 Push Options .有什么方法可以在 Web 用户界面或其他方式中检查管道或作业中使用了哪些推送选项?特别是,哪些 ci.variable 推送选项与作业或管道相关联?
所以,我试图在子目录上安装 gitlab。许多在线文章都表明现在可以这样做。 我安装了 omnibus-gitlab,但它似乎不包含使 gitlab 在 application.rb 等子目录中运行所
我当前的设置是我有一个安装了 gitlab (gitlabVM) 的 Ubuntu VM。 Gitlab 通过 8888 端口在 nginx 上运行 我的路由器配置如下: 外部 4322 -> git
我最近通过 Gitlab 更新了,但是备份文件是旧版本,新版本不兼容。所以我想将 Gitlab 回滚到以前的版本。怎么做? 最佳答案 GitLab 升级过程应该升级数据库(并且其他文件应该兼容)。 但
我在不同的网络上有两个单独的 git-lab 实例。我可以为他们每个人使用相同的运行者吗?假设,两个 git-lab 实例都可以访问带有运行器的服务器。是否可以为我的两个 git-lab 实例使用一个
我刚刚将我们的存储库从 github 转换为内部 gitlab。我首先获得了一个裸本地存储库,并且已经能够将一个新的 master 引入 gitlab。 在我的本地存储库中, git tag 显示了我
我看过这个:`git clone project2` in gitlab-ci.yml?以及一堆类似答案的类似帖子,暗示应该使用 Git 子模块。 如果不讨论 Git 中的子模块是否运行良好的争论,就
谁能帮我在 git lab 中自动生成发行说明。有什么方法可以执行此操作。 请让我知道。 谢谢 最佳答案 您可以使用 API 列出里程碑中的所有问题,请参阅 https://docs.gitlab.c
GitLab为与特定项目合作的“团队成员”提供项目访问级别“ guest ”,“报告者”,“开发者”和“大师”。 “主人”和“客人”是不言自明的,但是其他人对我的范围和粒度并不十分清楚。这些级别之间有
我已经在 CentOS 6.6 上安装了 Gitlab Omnibus gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm。我创建了一些项目并且运行良好,但我
我想知道在 2GB 内存和 2 个处理核心的情况下,GitLab 中允许的存储库和用户数量是否有上限。 最佳答案 这主要在GitLab requirements中指定。文档(如 CPU section
我很长一段时间都是 Bitbucket 的重度用户,但由于 GL 拥有先进的强大功能,我转向了 GitLab。 但是 Bitbucket 有一个令人惊叹的功能,我在 GitLab 中找不到……“下载”
在 GitLab 中,“聊天”选项卡始终显示没有事件用户: 如何启用它? 最佳答案 几年前,Gitlab 收购了一家公司,该公司生产 Slack 替代聊天系统,名为 Mattermost。您的 Git
在我的项目设置中我看到: 可用于任何项目的公共(public)部署 key (15) Rewind CFMM Ansible Deployment LRM Puppet Test gitlab-run
当我尝试创建 new project 时在 GitLab使用模板我提供了三个选项 * Ruby on Rails * Spring * NodeJSExpress 除了现有模板之外,是否可以添加自定义
我是一名优秀的程序员,十分优秀!