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

withDockerRegistry fails to authenticate with DockerHub

    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

              People

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

                Dates

                • Created:
                  Updated: