gitlab runner 问题汇集
gitlab runner 需要版本尽量和gitlab一致
1. gitlab docker executor: 错误 " gitlab runner Could not resolve host: abc.com "
fatal: unable to access 'http://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.localhost.com/root/test.git/': Could not resolve host: gitlab.localhost.co
需要在docker executor内增加一句 "network_mode = "host"
vim /etc/gitlab-runner/config.toml
[[runners]]
name = "docker"
url = "xxx"
id = 10
token = "xxx"
token_obtained_at = 2023-04-19T04:28:16Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "docker"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.docker]
tls_verify = false
image = "ubuntu:20.04"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
network_mode = "host"
refer: https://stackoverflow.com/questions/50325932/gitlab-runner-docker-could-not-resolve-host
2. gitlab shell executor 错误:
"gitlab shell Job failed: prepare environment: exit status 1."
解决方法, 注释掉 /home/gitlab-runner/.bash_logout 的所有内容
# ~/.bash_logout: executed by bash(1) when login shell exits.
# when leaving the console clear the screen to increase privacy
#if [ "$SHLVL" = 1 ]; then
# [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
#fi
refer : https://stackoverflow.com/questions/63154881/the-runner-of-type-shell-dont-work-job-failed-system-failure-preparing-envi
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?