"无法连接到Docker守护程序。"在gitlab-ci docker executor中构建docker镜像时出错

时间:2016-05-06 18:32:56

标签: docker gitlab-ci

我按照此处的说明操作:

http://doc.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker-executor

我绝对有"特权=真"在我的config.toml文件中,这是我的.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

我错过了什么吗?

2 个答案:

答案 0 :(得分:0)

也许docker-compose与docker-machine没有相同的版本。你确定都保存了版本

答案 1 :(得分:0)

跑步者是CentOS 6机器,最近失去了支持。我在CentOS 7机器上再试一次,一切正常。