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

Image.tag should accept repository name

XMLWordPrintable

      Image.tag should accept repository names. Currently tag relies on the repository provided in the build command. Attempting to retag an image prefixes the repository from the build, with no way of overriding the original value.

       

      Via the command line one can execute the following commands successfully

      docker build -t A
      docker tag A B/C:A
      docker push B/C:A

       

      However the analogous commands in jenkins produce a failure

      docker.build('A')
      image = docker.image('A')
      image.tag('B/C:A')

       

      In this example image.tag produces the output

      docker tag A A:B/C:A
      Error parsing reference: "A:B/C:A" is not a valid repository/tag: invalid reference format

       

      It's possible to execute the command successfully using a sh command in the pipeline, though at that point image.push does not pick up the tag and the push command must be executed via sh as well.

       

      Docker image functionality in the Jenkins Pipeline should replicate the behavior found in the underlying docker utility.

            allan_burdajewicz Allan BURDAJEWICZ
            psenet Paul Senet
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: