Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61286

Jenkins Docker Pipeline: Re-Tagging Doesn't work as expected

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi, please consider the following example.

       

      docker pull artifactory.mycompany.com/docker-dev/appname/dev:latest
      docker tag artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/test:latest
      docker push artifactory.mycompany.com/docker-dev/appname/test:latest
      

       

      Now if I try to do the same with the plugin then it doesn't work.

       

      image = docker.image("artifactory.mycompany.com/docker-dev/appname/dev:latest")
      image.pull()
      image.tag("artifactory.mycompany.com/docker-dev/appname/test:latest")
      image.push()
      

       

      I get error :

      Error parsing reference: "artifactory.mycompany.com/docker-dev/appname/dev:artifactory.mycompany.com/docker-dev/appname/test:latest" is not a valid repository/tag: invalid reference format

      If I do following

       

      image = docker.image("artifactory.mycompany.com/docker-dev/appname/dev:latest")
      image.pull()
      image.push("artifactory.mycompany.com/docker-dev/appname/test:latest")
      

       

      I get error: 

      Error parsing reference: "artifactory.mycompany.com/docker-dev/appname/dev:artifactory.mycompany.com/docker-dev/appname/test:latest" is not a valid repository/tag: invalid reference format

      If I do following

       

      image = docker.image("artifactory.mycompany.com/docker-dev/appname/dev:latest")
      image.pull()
      image.push("artifactory.mycompany.com/docker-dev/appname/test:latest artifactory.mycompany.com/docker-dev/appname/test:latest")
      

       

      I get following error

      "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

      In the logs I see following

      artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/dev:latest:artifactory.mycompany.com/docker-dev/appname/dev:latest artifactory.mycompany.com/docker-dev/appname/test:latest

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            niksgupt Nikhil Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: