这是.gitlab-ci.yml
文件
image: maven:3-jdk-8
build:
script: "mvn install -B"
然后构建将失败并出现以下错误
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
这是如何配置跑步者
docker exec -it gitlab-runner gitlab-runner register
Please enter the gitlab-ci coordinator URL (e.g. 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!
上面我还缺少什么?