"Cannot connect to the Docker daemon." 在 gitlab 中构建 docker 图像时出错-ci docker 执行器
"Cannot connect to the Docker daemon." error while building docker image in gitlab-ci docker executor
我正在按照此处的说明进行操作:
http://doc.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor
我的 config.toml 文件中肯定有 "privileged = true",这是我的 .gitlab-ci.yml:
的相关部分
sampleProjectDockerBuild:
stage: docker
image: docker:latest
services:
- docker:dind
before_script:
- docker info
script:
- docker build -t my-docker-image .
但我收到以下错误:
gitlab-ci-multi-runner 1.1.3 (a470667)
Using Docker executor with image docker:latest ...
Pulling docker image docker:dind ...
Starting service docker:dind ...
Waiting for services to be up and running...
Pulling docker image docker:latest ...
...
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ERROR: Build failed: exit code 1
我是不是漏掉了什么?
也许 docker-compose 不等于 docker-机器的版本。你们确定都保存版本
运行器是一台 CentOS 6 机器,最近失去了支持。我在 CentOS 7 机器上再次尝试,一切正常。
我正在按照此处的说明进行操作:
http://doc.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor
我的 config.toml 文件中肯定有 "privileged = true",这是我的 .gitlab-ci.yml:
的相关部分 sampleProjectDockerBuild:
stage: docker
image: docker:latest
services:
- docker:dind
before_script:
- docker info
script:
- docker build -t my-docker-image .
但我收到以下错误:
gitlab-ci-multi-runner 1.1.3 (a470667)
Using Docker executor with image docker:latest ...
Pulling docker image docker:dind ...
Starting service docker:dind ...
Waiting for services to be up and running...
Pulling docker image docker:latest ...
...
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ERROR: Build failed: exit code 1
我是不是漏掉了什么?
也许 docker-compose 不等于 docker-机器的版本。你们确定都保存版本
运行器是一台 CentOS 6 机器,最近失去了支持。我在 CentOS 7 机器上再次尝试,一切正常。