title: Trouble connecting to Docker daemon in GitLab CI
body: <p>I'm trying to create a fairly simple GitLab CI file to build out Docker images. Whenever I run the pipeline, I end up getting a Docker daemon connection issue. What can I do to properly build my image? Thanks!</p>
  <p><strong>GitLab CI:</strong></p>
  <pre><code>image: docker:20.10.16
  
  services:
    - docker:20.10.16-dind
  
  variables:
    DOCKER_HOST: tcp://docker:2375
  
  iac-build:
    stage: build
    extends: .iac
    rules:
      - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
        when: always
      - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
        when: never
      - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
        when: always
    script:
      - docker build -t testfirstimage .
    allow_failure: false
  </code></pre>
  <p>Error:</p>
  <pre><code>$ docker build -t testfirstimage .
  failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial tcp 127.0.0.1:2375: connect: connection refused
  Cleaning up project directory and file based variables
  ERROR: Job failed: command terminated with exit code 1
  </code></pre>