docker - gitlab-runner:无法连接到本地主机端口 80:连接被拒绝
问题描述
我在容器gitlab
上运行。docker
另外,我已经gitlab-runner
安装在我的 Cenots7 机器上。Runner 配置使用docker
执行器。
配置文件
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "test"
url = "http://localhost"
token = "gQfiiD4PUyPs4TiXLX9-"
executor = "docker"
log_level = "debug"
pre_clone_script = "ls -la"
clone_url = "http://localhost/"
[runners.docker]
tls_verify = false
image = "node"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
# network_mode = "gitlab_default"
# pull_policy = "never"
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
当跑步者接受工作时,它无法克隆 repo 并打印错误:
Cloning repository...
Cloning into '/builds/root/project'...
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@localhost/root/project.git/': Failed to connect to localhost port 80: Connection refused
/bin/bash: line 64: cd: /builds/root/project: No such file or directory
ERROR: Job failed: exit code 1
另外,我试过:clone_url = "http://172.17.0.1"
,但得到同样的错误
来自 docker 执行器的 ping:
ping 172.17.0.1
PING 172.17.0.1 (172.17.0.1): 56 data bytes
64 bytes from 172.17.0.1: seq=0 ttl=64 time=0.158 ms
64 bytes from 172.17.0.1: seq=1 ttl=64 time=0.090 ms
64 bytes from 172.17.0.1: seq=2 ttl=64 time=0.086 ms
64 bytes from 172.17.0.1: seq=3 ttl=64 time=0.084 ms
64 bytes from 172.17.0.1: seq=4 ttl=64 time=0.086 ms
64 bytes from 172.17.0.1: seq=5 ttl=64 time=0.087 ms
64 bytes from 172.17.0.1: seq=6 ttl=64 time=0.087 ms
64 bytes from 172.17.0.1: seq=7 ttl=64 time=0.109 ms
64 bytes from 172.17.0.1: seq=8 ttl=64 time=0.089 ms
64 bytes from 172.17.0.1: seq=9 ttl=64 time=0.088 ms
64 bytes from 172.17.0.1: seq=10 ttl=64 time=0.098 ms
64 bytes from 172.17.0.1: seq=11 ttl=64 time=0.088 m
解决方案
推荐阅读
- node.js - Nodejs获取打印到浏览器的结果,但它打印到控制台日志
- node.js - 关于使用 node、express 和 pug 进行 404“更新”调用的问题
- .net - GraphQL Hot Chocolate Constructor DI 在第二次请求时失败
- excel - 从多个工作簿中提取数据
- r - 安装 R Markdown 时出错
- javascript - Django 如何将数组发送到 JavaScript 以动态显示饼图?
- javascript - 更改选项时如何从表中动态创建的选择中获取 data-* 属性的值
- neutralinojs - 如何编写neutinoJS将窗口移动到0,0?
- python - 无法在 Python 数据框中的列表中使用 .find() 函数来查找字符的位置
- docker - docker-compose 容器没有启动