目录
1.1、错误描述
1.2、解决方案
1.1、错误描述
今天工作中,合并到了几个Git分支上的代码到dev环境,触发Gitlab流水线进行打包构建的时候,突然报错了,结果如下:
点进去查看具体的报错日志,报错信息见下图:
具体报错日志内容如下:
Running with gitlab-runner 16.2.1 (674e0e29)
on peis3-server E31Rk-xUH, system ID: s_7f3ce436cb66
Preparing the "docker" executor
00:09
ERROR: Failed to remove network for build
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (docker.go:826:0s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (docker.go:826:0s)
Will be retried in 3s ...
ERROR: Failed to remove network for build
ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (docker.go:826:0s)
Will be retried in 3s ...
ERROR: Job failed (system failure): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (docker.go:826:0s)
从报错日志上来看,可以发现是不能连接Dcoker daemon进程所导致的,并且它还提示docker daemon进程是否正在运行?从这的报错大概就可以知道问题的原因是:docker中的daemon守护进程没有启动。
1.2、解决方案
在linux服务器中,重新启动docker daemon守护进程,重启docker服务,执行下面的命令:
# 重新加载系统中的守护进程配置信息
sudo systemctl daemon-reload
# 重启docker服务
sudo systemctl restart docker
如下图所示:
执行成功之后,这个问题最终就解决了。