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

            raphink Raphaël PINSON created issue -
            raphink Raphaël PINSON made changes -
            Field Original Value New Value
            Description When using either `docker.withRegistry('', 'dockerhub')` or `withDockerRegistry(registry: [credentialsId: 'dockerhub'])`, a call to `mycont.push()` fails to authenticate with DockerHub:

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


            leads to:

            {code:logs}
            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
            {code}

            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.`
            When using either {{docker.withRegistry('', 'dockerhub')}} or {{withDockerRegistry(registry: [credentialsId: 'dockerhub'])}}, a call to {{mycont.push()}} fails to authenticate with DockerHub:

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


            leads to:

            {code:logs}
            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
            {code}

            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.`
            raphink Raphaël PINSON made changes -
            Description When using either {{docker.withRegistry('', 'dockerhub')}} or {{withDockerRegistry(registry: [credentialsId: 'dockerhub'])}}, a call to {{mycont.push()}} fails to authenticate with DockerHub:

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


            leads to:

            {code:logs}
            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
            {code}

            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.`
            When using either {{docker.withRegistry('', 'dockerhub')}} or {{withDockerRegistry(registry: [credentialsId: 'dockerhub'])}}, a call to {{mycont.push()}} fails to authenticate with DockerHub:

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


            leads to:

            {code:logs}
            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
            {code}

            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.`
            raphink Raphaël PINSON made changes -
            Description When using either {{docker.withRegistry('', 'dockerhub')}} or {{withDockerRegistry(registry: [credentialsId: 'dockerhub'])}}, a call to {{mycont.push()}} fails to authenticate with DockerHub:

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


            leads to:

            {code:logs}
            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
            {code}

            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.`
            When using either {{docker.withRegistry('', 'dockerhub')}} or {{withDockerRegistry(registry: [credentialsId: 'dockerhub'])}}, a call to {{mycont.push()}} fails to authenticate with DockerHub:

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


            leads to:

            {code:none}
            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
            {code}

            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.`
            raphink Raphaël PINSON made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            raphink Raphaël PINSON made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jglick Jesse Glick made changes -
            Component/s docker-commons-plugin [ 20628 ]
            jglick Jesse Glick made changes -
            Status Reopened [ 4 ] Open [ 1 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-workflow PR 71 (Web Link)" [ 14910 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-28702 [ JENKINS-28702 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-32022 [ JENKINS-32022 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-workflow PR 72 (Web Link)" [ 14911 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-commons PR 55 (Web Link)" [ 14912 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-46321 [ JENKINS-46321 ]
            ifernandezcalvo Ivan Fernandez Calvo made changes -
            Link This issue is related to JENKINS-34958 [ JENKINS-34958 ]
            ifernandezcalvo Ivan Fernandez Calvo made changes -
            Link This issue is related to JENKINS-44143 [ JENKINS-44143 ]
            ifernandezcalvo Ivan Fernandez Calvo made changes -
            Link This issue is related to JENKINS-45851 [ JENKINS-45851 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal CD-316 (Web Link)" [ 19019 ]
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-2612 (Web Link)" [ 19529 ]
            jglick Jesse Glick made changes -
            Component/s docker-build-publish-plugin [ 18624 ]
            jglick Jesse Glick made changes -
            Component/s docker-custom-build-environment-plugin [ 20634 ]
            jglick Jesse Glick made changes -
            Assignee Jesse Glick [ jglick ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-commons PR 67 (Web Link)" [ 20000 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "docker-workflow PR 133 (Web Link)" [ 20001 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-48458 [ JENKINS-48458 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Page (Jenkins Wiki)" [ 20656 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "Page (Jenkins Wiki)" [ 20659 ]
            jglick Jesse Glick made changes -
            Link This issue is blocked by JENKINS-51395 [ JENKINS-51395 ]
            jglick Jesse Glick made changes -
            Link This issue is blocked by JENKINS-51397 [ JENKINS-51397 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-41051 [ JENKINS-41051 ]
            jglick Jesse Glick made changes -
            Component/s docker-build-publish-plugin [ 18624 ]
            Component/s docker-custom-build-environment-plugin [ 20634 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-51407 [ JENKINS-51407 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-51406 [ JENKINS-51406 ]
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-33985 [ JENKINS-33985 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-51949 [ JENKINS-51949 ]

              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: