GitLab Runner couldn’t correctly resolve a domain name

Summary

GitLab Runner couldn’t correctly resolve a domain name.
It seems to DNS priority higher than hosts file.
I hope that GitLab Runner can get local IP.
The environment follows.
By the way, I read and tried follows.

Thank you for your cooperation.

GitLab’s version

  • GitLab: 10.3.7
  • GitLab Runner: 10.7.0-1
  • OS(GitLab Runner): CentOS 7.4.1708 x86_64

GitLab Runner’s prompt

.gitlab-ci.yml

stages:
  - build-docker

build-docker-image:
  stage: build-docker
  image: docker:stable
  services:
    - docker:dind
  before_script:
    - cat /etc/hosts
    - ping -c 2 hoge.com
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN https://hoge.com:444
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"

/etc/gitlab-runner/config.toml

concurrent = 1
check_interval = 0

[[runners]]
  name = "for shota.ito/go-server"
  url = "https://hoge.com:4343/"
  token = "XXXX"
  executor = "docker"
  clone_url = "https://hoge.com:4343"
  environment = ["GODEBUG=netdns=cgo"]
  [runners.docker]
    privileged = true
    disable_cache = false
    volumes = ["/cache"]
    extra_hosts = ["hoge.com:192.168.12.15"]
    shm_size = 0
  [runners.cache]

I found it.
It’s similar to the Issue.
I will wait that it released.