I've recently created a new repository in gitlab.com, started a new Ubuntu instance in digitalocean, installed docker and gitlab-runner in the ubuntu instance. Also, did gitlab-runner register and passed the correct host and token from gitlab.com ci/cd settings. Pushed a branch, and the expected pipeline job runs but fails, presenting the error:
error during connect: Get http://docker:2375/v1.40/containers/json?all=1: dial tcp: lookup docker on 67.207.67.2:53: no such host
Just followed the basic steps and expected it to work perfectly. By looking for the error when google search, there's no info.
The config.toml file, which is created automatically on gitlab-runner register:
concurrent = 1
check_interval = 0
[[runners]]
name = "digital ocean runner"
url = "https://gitlab.com/"
token = "xxxxxxxxxxxxxxxxx"
executor = "docker"
[runners.docker]
tls_verify = false
image = "ruby:2.1"
privileged = true
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
The gitlab ci file:
image: docker:latest
services:
- docker:dind
stages:
- test
test-build:
stage: test
script:
- echo "Fine!"
- docker info
tags:
- docker
Steps to reproduce
open a gitlab.com account
Install Ubuntu latest
Install gitlab-runner
do `register` and should have the config.toml above
What causes this issue?
The error log for one one of the tests, not for the job above:
Running with gitlab-runner 12.3.0 (a8a019e0)
on foobar laptop szWcjfZg
Using Docker executor with image foobar/docker-bash ...
Starting service docker:dind ...
Authenticating with credentials from /Users/foobar/.docker/config.json
Pulling docker image docker:dind ...
Using docker image sha256:5768e15eefd175c1ba6969b616cfe827152556c5fe691b9258cb57d1a5c37e9d for docker:dind ...
Waiting for services to be up and running...
*** WARNING: Service runner-szWcjfZg-project-14670943-concurrent-0-docker-0 probably didn't start properly.
Health check error:
service "runner-szWcjfZg-project-14670943-concurrent-0-docker-0-wait-for-service" timeout
Health check container logs:
Service container logs:
2019-10-05T23:18:52.128774700Z Generating RSA private key, 4196 bit long modulus (2 primes)
2019-10-05T23:18:53.209639200Z .......................................................................................................................................................................................++++
2019-10-05T23:18:53.694383300Z .......................................................................................++++
2019-10-05T23:18:53.694784400Z e is 65537 (0x010001)
2019-10-05T23:18:53.710661300Z Generating RSA private key, 4196 bit long modulus (2 primes)
2019-10-05T23:18:53.789938500Z ............++++
2019-10-05T23:18:54.926850200Z ..............................................................................................................................................................................................................++++
2019-10-05T23:18:54.927064600Z e is 65537 (0x010001)
2019-10-05T23:18:54.953296700Z Signature ok
2019-10-05T23:18:54.953354500Z subject=CN = docker:dind server
2019-10-05T23:18:54.953422500Z Getting CA Private Key
2019-10-05T23:18:54.967240700Z /certs/server/cert.pem: OK
2019-10-05T23:18:54.970126300Z Generating RSA private key, 4196 bit long modulus (2 primes)
2019-10-05T23:18:55.244959900Z .................................................++++
2019-10-05T23:18:55.317443900Z ...........++++
2019-10-05T23:18:55.317858100Z e is 65537 (0x010001)
2019-10-05T23:18:55.339564700Z Signature ok
2019-10-05T23:18:55.339581700Z subject=CN = docker:dind client
2019-10-05T23:18:55.339671300Z Getting CA Private Key
2019-10-05T23:18:55.356469400Z /certs/client/cert.pem: OK
2019-10-05T23:18:55.359632000Z mount: permission denied (are you root?)
2019-10-05T23:18:55.359866500Z Could not mount /sys/kernel/security.
2019-10-05T23:18:55.359910700Z AppArmor detection and --privileged mode might break.
2019-10-05T23:18:55.361037300Z mount: permission denied (are you root?)
*********
Authenticating with credentials from /Users/foobar/.docker/config.json
Pulling docker image foobar/docker-bash ...
Using docker image sha256:2ecf555077c9d0a7df0cc45188094a84fbbae4ce4c28cac37a652e9765bf3157 for foobar/docker-bash ...
Authenticating with credentials from /Users/foobar/.docker/config.json
Running on runner-szWcjfZg-project-14670943-concurrent-0 via Foobar-MacBook-Pr.local...
Authenticating with credentials from /Users/foobar/.docker/config.json
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /builds/foobar/foobar-project/.git/
Checking out 4f9789a7 as review-ci-test...
Skipping Git submodules setup
Authenticating with credentials from /Users/foobar/.docker/config.json
Authenticating with credentials from /Users/foobar/.docker/config.json
Authenticating with credentials from /Users/foobar/.docker/config.json
$ echo "INFO - Clear exited containers" # collapsed multi-line command
INFO - Clear exited containers
INFO - List all services running...
error during connect: Get http://docker:2375/v1.40/containers/json?all=1: dial tcp: lookup docker on 192.168.65.1:53: no such host
Authenticating with credentials from /Users/foobar/.docker/config.json
ERROR: Job failed: exit code 1