title: Gitlab CI fails with ERROR: Job failed: exit code 1
body: <p>I am pretty new to gitlab ci and I have a project with a pre-existing gitlab configuration which was running fine but after pushing a few code changes, it has now completely stopped working and I can't figure out why. Here is the <code>.gitlab-ci.yml</code></p>
  
  <pre><code>stages:
    - build
    - deploy
  
  variables:
    DOCKER_HOST: tcp://localhost:2375
  
  assets:
    stage: build
    image: node:10-alpine
    script:
      - npm ci
      - NODE_ENV=production npm run build
    artifacts:
      expire_in: 1 day
      paths:
        - public/assets
    tags:
      - docker
  
  package:
    stage: deploy
    image: php:7.3-cli-alpine
    dependencies:
      - assets
    before_script:
      - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
      - php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
      - php composer-setup.php --install-dir=/usr/local/bin --filename=composer
      - php -r "unlink('composer-setup.php');"
    script:
      - composer install --prefer-dist --no-progress --optimize-autoloader --no-scripts
      - rm -fr .git
    artifacts:
      expire_in: 1 day
      paths:
        - .
    tags:
      - docker
  
  docker:
    stage: deploy
    image: docker:latest
    services:
      - docker:18-dind
    dependencies:
      - assets
    script:
      - docker build -t $CI_REGISTRY_IMAGE:latest .
      - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
      - docker push $CI_REGISTRY_IMAGE:latest
    only:
      - master
    tags:
      - docker
  
  deploy:
    stage: deploy
    image: php:7.3-cli-alpine
    dependencies:
      - assets
    before_script:
      - curl -LO https://deployer.org/deployer.phar
      - mv deployer.phar /usr/local/bin/dep
      - chmod +x /usr/local/bin/dep
      - apk add --update openssh rsync
      - eval $(ssh-agent -s)
      - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
      - mkdir -p ~/.ssh
      - chmod 700 ~/.ssh
      - ssh-keyscan -t rsa domain.co.uk &gt;&gt; /root/.ssh/known_hosts
    script:
      - dep deploy -p --tag="$CI_COMMIT_TAG"
    only:
      - tags
    tags:
      - docker
  </code></pre>
  
  <p>I am consistently getting the following error and I am wondering what has changed and if it is the server or gitlab-ci causing the following issue. I checked the server and it's running fine but there is no docker installed there and I presume the docker is not supposed to be installed on the server for what it is trying to do anyways?</p>
  
  <pre><code>Checking out a50d58fd as master...
   Skipping Git submodules setup
  Downloading artifacts for assets (447059035)...
  00:01
   Downloading artifacts from coordinator... ok        id=447059035 responseStatus=200 OK token=cp4GCzgJ
  $ docker build -t $CI_REGISTRY_IMAGE:latest .
  00:02
   time="2020-02-24T03:53:41Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial tcp [::1]:2375: connect: connection refused"
   error during connect: Post http://localhost:2375/v1.40/build?buildargs=%7B%7D&amp;cachefrom=%5B%5D&amp;cgroupparent=&amp;cpuperiod=0&amp;cpuquota=0&amp;cpusetcpus=&amp;cpusetmems=&amp;cpushares=0&amp;dockerfile=Dockerfile&amp;labels=%7B%7D&amp;memory=0&amp;memswap=0&amp;networkmode=default&amp;rm=1&amp;session=sja0dvuf6gm0w8tneigulo3ha&amp;shmsize=0&amp;t=registry.gitlab.com%2Fnir.npl%2Fbrayleys-honda%3Alatest&amp;target=&amp;ulimits=null&amp;version=1: context canceled
   ERROR: Job failed: exit code 1
  </code></pre>