Gitlab CI编译失败,“准备失败:无法连接到Docker端点”

这里是.gitlab-ci.yml文件

 image: maven:3-jdk-8 build: script: "mvn install -B" 

那么构build将失败,并出现以下错误

 Running with gitlab-ci-multi-runner 1.8.0 (734bc5d) Using Docker executor with image maven:3-jdk-8 ... ERROR: Preparation failed: cannot connect to Docker endpoint Will be retried in 3s ... Using Docker executor with image maven:3-jdk-8 ... ERROR: Preparation failed: cannot connect to Docker endpoint Will be retried in 3s ... Using Docker executor with image maven:3-jdk-8 ... ERROR: Preparation failed: cannot connect to Docker endpoint Will be retried in 3s ... ERROR: Build failed (system failure): cannot connect to Docker endpoint 

这是如何启动亚军

 docker run -d --name gitlab-runner --restart always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /srv/gitlab-runner/config:/etc/gitlab-runner \ gitlab/gitlab-runner:latest 

这是如何configuration跑步者

 docker exec -it gitlab-runner gitlab-runner register Please enter the gitlab-ci coordinator URL (eg https://gitlab.com ) https://gitlab.com Please enter the gitlab-ci token for this runner xxx Please enter the gitlab-ci description for this runner my-runner INFO[0034] fcf5c619 Registering runner... succeeded Please enter the executor: shell, docker, docker-ssh, ssh? docker Please enter the Docker image (eg. ruby:2.1): maven:3-jdk-8 INFO[0037] Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 

还有什么我只是在上面丢失?