title: Docker build failed: tag invalid reference format (Gitlab CI)
body: <p>I've created a repo in gitlab for a Dockerfile.
  In the .gitlab-ci.yml i defined two stages: build and push to the registry.</p>
  
  <p>This is the .gitlab-ci.yml file:</p>
  
  <pre><code>image: docker
  
  stages:
      - build
      - push
  
  build:
      stage: build
      script:
        - docker build --no-cache -t ${DOCKER_REGISTRY}/debian9-cunit .
  
  push:
      stage: push
      script:
        - docker push ${DOCKER_REGISTRY}/debian9-cunit
  </code></pre>
  
  <p>When I run the pipeline, the build stage fails saying: </p>
  
  <blockquote>
    <p>invalid argument "/debian9-cunit" for "-t, --tag" flag: invalid reference format</p>
  </blockquote>
  
  <p>The same exact code (with only a different name after "/debian9-") works with no problem in another repo of a collegue. 
  What can be the problem?</p>