title: Docker image retag for build promotion
body: <p>I am trying to promote a docker image in my Jenkins pipeline using Jenkins docker plugin but I am able to do so as I am getting following error.</p>
  
  <pre><code>"docker tag" requires exactly 2 arguments.
  See 'docker tag --help'.
  
  Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
  
  Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  </code></pre>
  
  <p>I can see the following in the logs</p>
  
  <pre><code>docker tag artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/dev:artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/test:latest
  </code></pre>
  
  <p>Pipeline code:</p>
  
  <pre><code>testImage = docker.image("artifactory.mycompany.com/docker-dev/appname/dev:latest")
  
  testImage.pull()
  
  testImage.push("artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/test:latest" )
  </code></pre>
  
  <p>Any idea what's wrong here...         </p>
  
  <p>Edit#1:
  If I do following the I get different error.</p>
  
  <pre><code>testImage = docker.image("artifactory.mycompany.com/docker-dev/appname/dev:latest")
  
  testImage.pull()
  
  testImage.tag("artifactory.mycompany.com/docker-dev/appname/test:latest")
  
  testImage.push( )
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error parsing reference: "artifactory.mycompany.com/docker-dev/appnamee/dev:artifactory.mycompany.com/docker-dev/appname/test:latest" is not a valid repository/tag: invalid reference format
  </code></pre>