当我在文件 .gitlab-ci.yml 中运行此命令“$ docker build --pull -t e45 .”时,我收到错误

问题描述 投票:0回答:1

gitlab-runner 给出错误:

ERROR: error during connect: Get "http://docker:2375/_ping": dial tcp: lookup docker on 127.0.0.53:53: server misbehaving

当它尝试运行命令时

docker build --pull -t my-image 
this is my gitlab-ci.yaml

this my pipeline log

我期待 gitlab-runner 能够毫无问题地创建图像

docker dockerfile gitlab-ci devops gitlab-ci-runner
1个回答
0
投票

您需要通过向 GitLab 运行程序配置文件添加卷来将主机 docker 套接字映射到运行程序套接字

主机中的 gitlab-runner 配置文件路径:

/etc/gitlab-runner/config.toml

添加这些行

privileged = true
volumes = ["/cache","/var/run/docker.sock:/var/run/docker.sock"]
© www.soinside.com 2019 - 2024. All rights reserved.