title: GitLab pipeline is failing due to invalid docker build tag reference
body: <p>I am trying to run a GitLab pipe line for a Spring boot project with branch name as 'test-pipeline' as part of a POC. The pipeline is failing with below error. The tag reference has '/' character in the beginning. Not sure if this causing the issue.</p>
  <pre><code>Running before_script and script
  00:03
   $ if [[ -z &quot;$CI_COMMIT_TAG&quot; ]]; then # collapsed multi-line command
   $ /build/build.sh
   Building Heroku-based application using gliderlabs/herokuish docker image...
   invalid reference format
   invalid reference format
   invalid argument &quot;/test-pipeline:feec5e03aac2aa1968594056d67b9e43d2240e24&quot; for &quot;-t, --tag&quot; flag: invalid reference format
   See 'docker build --help'
  </code></pre>
  <p>Below is the gitlab-ci.yml.</p>
  <pre><code>image: maven:3.3-jdk-8
  stages:
    - test
    - deploy
  test_job:
    stage: test
    script:
      - pwd
      - mvn clean
      - mvn compile
      - mvn test
    tags:
      - docker
  
  </code></pre>
  <p>GitLab version: 12.10.14
  GitLab Runner version: 12.10.3</p>
  <p>As the tag name is internally picked up by the pipeline not sure how to fix this.</p>
  <p>Please help.</p>