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

imageName() drops registry prefix outside of withRegistry() block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • docker-workflow-plugin

      I have this pipeline:

      node {
           docker.withRegistry('https://my-private-repo') {
              sh 'echo "FROM ubuntu" > Dockerfile'
              img = docker.build('my-test-image:1.0.0')
              print img.imageName()
          }
          print img.imageName()
      }
      

      When the first print is done I get the expected full name with the registry prefix.
      The 2nd print however drops the registry prefix and I just get the id.

      Was not expecting that since the img object did not change.

            Unassigned Unassigned
            apioli Anthony Pioli
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: