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

withDockerRegistry fails to authenticate with DockerHub

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using either docker.withRegistry('', 'dockerhub') or withDockerRegistry(registry: [credentialsId: 'dockerhub']), a call to mycont.push() fails to authenticate with DockerHub:

        withDockerRegistry(registry: [credentialsId: 'dockerhub']) {
          cont.push()
          cont.push('latest')
        }
      

      leads to:

      Proceeding
      [Pipeline] withDockerRegistry
      [Pipeline] {
      [Pipeline] sh
      [test] Running shell script
      + docker tag --force=true camptocamp/jenkins-test camptocamp/jenkins-test:latest
      unknown flag: --force
      See 'docker tag --help'.
      + docker tag camptocamp/jenkins-test camptocamp/jenkins-test:latest
      [Pipeline] sh
      [test] Running shell script
      + docker push camptocamp/jenkins-test:latest
      The push refers to a repository [docker.io/camptocamp/jenkins-test]
      749689370cd8: Preparing
      unauthorized: authentication required
      [Pipeline] }
      [Pipeline] // withDockerRegistry
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      

      I have the credentials set up properly in Jenkins, as shown in the attached screenshot, but Jenkins Credentials Manager says `This credential has not been recorded as used anywhere.`

        Attachments

          Issue Links

            Activity

            Hide
            senseysensor Alex Al added a comment -

            Nico Navarrete, the same here. After downgrading to version 1.15.1 everything works fine. Jenkins 2.107.3.

            Show
            senseysensor Alex Al added a comment - Nico Navarrete , the same here. After downgrading to version 1.15.1 everything works fine. Jenkins 2.107.3.
            Hide
            jglick Jesse Glick added a comment -

            Please do not comment further on this issue. Check JENKINS-51395 and JENKINS-51397, or file a fresh bug and link it here if you are sure you have encountered a distinct issue.

            Show
            jglick Jesse Glick added a comment - Please do not comment further on this issue. Check JENKINS-51395 and JENKINS-51397 , or file a fresh bug and link it here if you are sure you have encountered a distinct issue.
            Hide
            jglick Jesse Glick added a comment -

            Filed JENKINS-51406 & JENKINS-51407 for integration into other non-Pipeline plugins, so this issue can be considered strictly about Docker Pipeline.

            Show
            jglick Jesse Glick added a comment - Filed JENKINS-51406 & JENKINS-51407 for integration into other non-Pipeline plugins, so this issue can be considered strictly about Docker Pipeline.
            Hide
            vwbusguy Scott Williams added a comment -

            Jesse Glick What docker login environment problem?  Docker login works fine from CLI, ansible, or this plugin from 1.15.1 and previous.  Between this and the breaking ENTRYPOINT in 1.15.x, I'm at my last straw with this plugin and possibly even Jenkins itself as Docker has become such a core of our operations.  I'm happy to help test and possibly contribute code, but I just can't continue having my teams rely on a feature that has major regressions every update and the CloudBees devs keep dismissing the people reporting the issues and trying to fix them.  It's never fun when we have to keep spending our time debugging and coding workarounds for this plugin rather than the code we're trying to test to begin with. 

            Show
            vwbusguy Scott Williams added a comment - Jesse Glick What docker login environment problem?  Docker login works fine from CLI, ansible, or this plugin from 1.15.1 and previous.  Between this and the breaking ENTRYPOINT in 1.15.x, I'm at my last straw with this plugin and possibly even Jenkins itself as Docker has become such a core of our operations.  I'm happy to help test and possibly contribute code, but I just can't continue having my teams rely on a feature that has major regressions every update and the CloudBees devs keep dismissing the people reporting the issues and trying to fix them.  It's never fun when we have to keep spending our time debugging and coding workarounds for this plugin rather than the code we're trying to test to begin with. 
            Hide
            jglick Jesse Glick added a comment -

            Scott Williams please see the linked issues and update your plugins.

            Show
            jglick Jesse Glick added a comment - Scott Williams please see the linked issues and update your plugins.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                raphink Raphaël PINSON
              • Votes:
                16 Vote for this issue
                Watchers:
                35 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: