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

withRegistry is not doing a "docker login"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • docker-workflow-plugin
    • None
    • Linux

      I have a block in my pipeline script like the following:

      		docker.withRegistry("http://ourhost:5100", params.JP_DockerMechIdCredential) {
      			def	image = docker.build("com.att.sharedservices/tomee-uslmonitor")
      			image.push 'latest'
      		}
      

      Before this block of code, I extracted the username and password from the credential, and they are correct.

      In the log, I watched it build the image, tag it, but then when it tried to push it, it failed to authenticate. I didn't see a "docker login" command line in the log.

      I then tried to manually run the docker commands from the shell, on the same box the job is running on, starting with "docker login". That entire process worked.

      I then reran my job, and it also worked.

      I then moved my "~/.docker/config.json" file out of the way and reran my job, and it failed to authenticate again. It's just not attempting "docker login".

            magnayn magnayn
            dkarr David Karr
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: