Looking for help on this one. Am quite new in gitlab-ci, although bit experienced with docker.
All my attempts at getting my docker executor to build successfully is failing at:
Running with gitlab-runner 11.1.0 (081978aa)
on my-runner 28d98f88
Using Docker executor with image docker:latest ...
Starting service docker:dind ...
Using locally found image version due to if-not-present pull policy
Using docker image sha256:9c33e070d450c33d0fda38016a1c454fcf296efc5af773d88fb5a5d17a99affc for docker:dind ...
Waiting for services to be up and running...
Using locally found image version due to if-not-present pull policy
Using docker image sha256:8f769f924e650ea5f873bede823add9e33aa6c74a2b2dd8ccd54c2c9e97ce1d3 for docker:latest ...
Running on runner-28d98f88-project-9-concurrent-0 via gitlab.home...
Cloning repository...
Cloning into '/builds/root/gocryptme'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@cicd.home/root/gocryptme.git/': Could not resolve host: cicd.home
ERROR: Job failed: exit code 1
In short:
Could not resolve host: cicd.home
Have tried all suggestions i've come across so far.
My .gitlab-ci.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- test
- release
- deploy
variables:
DOCKER_CI_IMAGE: cicd.home:4567/root/cidemo:cicd
before_script:
- whoami
- echo '10.11.0.130 cicd.home' >> /etc/hosts
build-image:
stage: build
tags:
- docker
script:
- docker build --pull -t $DOCKER_CI_IMAGE .
- docker push $DOCKER_CI_IMAGE
For sure the before_script: section does not yield expected outputs.
Here is my config.toml
concurrent = 1
check_interval = 0
[[runners]]
name = "my-runner"
url = "https://cicd.home/"
token = "28d98f88b621865293c49c7fadfc5d"
executor = "docker"
[runners.docker]
tls_verify = false
privileged = true
disable_cache = false
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock:rw"]
shm_size = 0
pull_policy = "if-not-present"
[runners.cache]
To me it seems the procedure to add to /etc/hosts is not working here.