title: Docker error during connect: Post http://docker:2375/v1.24/auth
body: <p>I am using a docker+machine to run my gitlab ci/cd jobs.
  My .gitlab-ci.yml looks as such:</p>
  <pre><code>image: docker:latest
  
  variables:
    DOCKER_HOST: tcp://docker:2375/
    DOCKER_TLS_CERTDIR: &quot;&quot;
  
  services:
    - docker:19.03.12-dind
  
  stages:
    - build
    - deploy
  
  before_script:
    - mkdir -p ~/.ssh
    - echo &quot;$SSH_PRIVATE_KEY&quot; | tr -d '\r' &gt; ~/.ssh/id_rsa
    - chmod 700 ~/.ssh/id_rsa
    - eval &quot;$(ssh-agent -s)&quot;
    - ssh-add ~/.ssh/id_rsa
    - '[[ -f /.dockerenv ]] &amp;&amp; echo -e &quot;Host *\n\tStrictHostKeyChecking no\n\n&quot; &gt; ~/.ssh/config'
  
  build:
    stage: build
    script:
      - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.gitlab.com
      - docker info
      - apk add --no-cache py-pip python3-dev libffi-dev openssl-dev gcc libc-dev make
      - export CRYPTOGRAPHY_DONT_BUILD_RUST=1
      - pip install docker-compose
  </code></pre>
  <p>And my config.toml looks like this:</p>
  <pre><code>concurrent = 1
  check_interval = 0
  
  [session_server]
    session_timeout = 1800
  
  [[runners]]
    name = &quot;Docker Runner&quot;
    url = &quot;https://gitlab.com&quot;
    token = &quot;**&quot;
    executor = &quot;docker&quot;
    [runners.custom_build_dir]
    [runners.cache]
      [runners.cache.s3]
      [runners.cache.gcs]
      [runners.cache.azure]
    [runners.docker]
      tls_verify = false
      image = &quot;docker:stable&quot;
      privileged = true
      disable_entrypoint_overwrite = false
      oom_kill_disable = false
      disable_cache = false
      volumes = [&quot;/var/run/docker.sock:/var/run/docker.sock&quot;, &quot;/cache&quot;]
      shm_size = 0
  
  </code></pre>
  <p>When reaching command: &quot;docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.gitlab.com&quot;
  GitLab outputs this:</p>
  <pre><code>$ [[ -f /.dockerenv ]] &amp;&amp; echo -e &quot;Host *\n\tStrictHostKeyChecking no\n\n&quot; &gt; ~/.ssh/config
  $ docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD registry.gitlab.com
  WARNING! Using --password via the CLI is insecure. Use --password-stdin.
  error during connect: Post http://docker:2375/v1.24/auth: dial tcp: lookup docker on 172.31.0.2:53: no such host
  Cleaning up file based variables 00:01
  ERROR: Job failed: exit code 1
  </code></pre>
  <p>I do not understand where the mistake could be... After changing both the ci file and the config.toml.</p>