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

Docker publish plugin throws error "Please login prior to push" after publishing the image

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      [abc-docker-image-test] $ docker build -t admin/abc:3.2.4-1137 abc/xyz/3.2.4
      Sending build context to Docker daemon 9.728 kB

      Sending build context to Docker daemon
      Step 0 : FROM ubuntu:precise
      ---> 1f80e9ca2ac3
      ...
      ....
      Successfully built 0bfa936c91ea

      [abc-docker-image-test] $ docker tag --force=true 0bfa936c91ea admin/abc:latest

      [abc-docker-image-test] $ docker push admin/abc:3.2.4-1137
      The push refers to a repository [admin/abc] (len: 1)
      Sending image list

      Please login prior to push:
      Username: EOF

      Build step 'Docker build and publish' marked build as failure

        Attachments

          Activity

          Hide
          michaelneale Michael Neale added a comment -

          can you share more of your config for the job and plugin? that looks lik eit is missing the username in the settings.

          Show
          michaelneale Michael Neale added a comment - can you share more of your config for the job and plugin? that looks lik eit is missing the username in the settings.
          Hide
          maneeshmp Maneesh M P added a comment -

          I have attached image with config page

          Show
          maneeshmp Maneesh M P added a comment - I have attached image with config page
          Hide
          michaelneale Michael Neale added a comment -

          I can't reproduce this.

          I cleared my ~/.dockercfg and then put in my details into jenkins- and it logged in and worked.

          I would suggest removing the ~/.dockercfg - and then trying again. Also - check you can push from the same machine as the same user with docker login being called.

          Otherwise - it is something odd with the registry config.

          Show
          michaelneale Michael Neale added a comment - I can't reproduce this. I cleared my ~/.dockercfg and then put in my details into jenkins- and it logged in and worked. I would suggest removing the ~/.dockercfg - and then trying again. Also - check you can push from the same machine as the same user with docker login being called. Otherwise - it is something odd with the registry config.
          Hide
          qnerden Quentin Nerden added a comment - - edited

          **UPDATE** after upgrading the plugin from 0.15 to 1.0, the problem is gone, it works for me.
          **UPDATE2** Docker 1.6 uses the V2 registry of Dockerhub by default. The V2 registry url should not be specified.

          I have the same problem, with the registry "https://registry-1.docker.io/v2" (official v2 registry for Dockerhub).
          Docker 1.6.2 is used, and the jenkins .dockercfg file was deleted before running the job.
          The error in the job's console is:

          (...)
          workspace] $ docker login -u jenkinsuser -e jenkins-user@comp....com -p ******** https://registry-1.docker.io/v2/
          WARNING: login credentials saved in /opt/jenkins/.dockercfg.
          Login Succeeded
          [workspace] $ docker build -t mydocker/repo:873 $WORKSPACE/target
          Sending build context to Docker daemon 557.1 kB
          (...)
          Sending build context to Docker daemon 98.04 MB
          Sending build context to Docker daemon 98.59 MB
          Sending build context to Docker daemon 98.59 MB

          Sending build context to Docker daemon
          Step 0 : FROM mydocker/repo:base2
          ---> 55604c2a11e7
          Step 1 : ADD comp-web.war /server/standalone/deployments/
          ---> e1a25eef96e3
          Removing intermediate container 0118fd978788
          Successfully built e1a25eef96e3
          [workspace] $ docker push mydocker/repo:873
          The push refers to a repository [mydocker/repo] (len: 1)
          e1a25eef96e3: Buffering to Disk
          e1a25eef96e3: Image push failed

          Please login prior to push:
          Username: EOF
          Build step 'Docker Build and Publish' marked build as failure

          Show
          qnerden Quentin Nerden added a comment - - edited ** UPDATE ** after upgrading the plugin from 0.15 to 1.0, the problem is gone, it works for me. ** UPDATE2 ** Docker 1.6 uses the V2 registry of Dockerhub by default. The V2 registry url should not be specified. I have the same problem, with the registry "https://registry-1.docker.io/v2" (official v2 registry for Dockerhub). Docker 1.6.2 is used, and the jenkins .dockercfg file was deleted before running the job. The error in the job's console is: (...) workspace] $ docker login -u jenkinsuser -e jenkins-user@comp....com -p ******** https://registry-1.docker.io/v2/ WARNING: login credentials saved in /opt/jenkins/.dockercfg. Login Succeeded [workspace] $ docker build -t mydocker/repo:873 $WORKSPACE/target Sending build context to Docker daemon 557.1 kB (...) Sending build context to Docker daemon 98.04 MB Sending build context to Docker daemon 98.59 MB Sending build context to Docker daemon 98.59 MB Sending build context to Docker daemon Step 0 : FROM mydocker/repo:base2 ---> 55604c2a11e7 Step 1 : ADD comp-web.war /server/standalone/deployments/ ---> e1a25eef96e3 Removing intermediate container 0118fd978788 Successfully built e1a25eef96e3 [workspace] $ docker push mydocker/repo:873 The push refers to a repository [mydocker/repo] (len: 1) e1a25eef96e3: Buffering to Disk e1a25eef96e3: Image push failed Please login prior to push: Username: EOF Build step 'Docker Build and Publish' marked build as failure
          Hide
          recena Manuel Recena Soto added a comment -

          I'm getting the same error. My environment is:

          • CloudBees Docker Build and Publish plugin v1.0
          • Jenkins 1.609.1
          • Mac OSX
          Show
          recena Manuel Recena Soto added a comment - I'm getting the same error. My environment is: CloudBees Docker Build and Publish plugin v1.0 Jenkins 1.609.1 Mac OSX
          Hide
          csanchez Carlos Sanchez added a comment -

          I don't see anywhere that https://registry-1.docker.io/v2/ is the default registry for 1.6. When I do Docker login without registry it creates a https://index.docker.io/v1/ in ~/.dockercfg in both 1.6.0 and 1.6.2 (OSX homebrew).

          Are you explicitly setting https://registry-1.docker.io/v2/ in the registry field in Jenkins?

          So seems that for docker https://registry-1.docker.io/v2/ is like a private registry and you should prepend it to the image name as in docker push registry-1.docker.io/mydocker/repo

          Show
          csanchez Carlos Sanchez added a comment - I don't see anywhere that https://registry-1.docker.io/v2/ is the default registry for 1.6. When I do Docker login without registry it creates a https://index.docker.io/v1/ in ~/.dockercfg in both 1.6.0 and 1.6.2 (OSX homebrew). Are you explicitly setting https://registry-1.docker.io/v2/ in the registry field in Jenkins? So seems that for docker https://registry-1.docker.io/v2/ is like a private registry and you should prepend it to the image name as in docker push registry-1.docker.io/mydocker/repo
          Hide
          csanchez Carlos Sanchez added a comment -

          And seems that you get the "Please login prior to push" when you try to push an image that you don't have permissions to push in the hub

          Show
          csanchez Carlos Sanchez added a comment - And seems that you get the "Please login prior to push" when you try to push an image that you don't have permissions to push in the hub
          Hide
          recena Manuel Recena Soto added a comment -

          Hi Carlos Sanchez, thanks so much for your help. IMO we can close this issue because the problem was related to permissions on DockerHub.

          Show
          recena Manuel Recena Soto added a comment - Hi Carlos Sanchez , thanks so much for your help. IMO we can close this issue because the problem was related to permissions on DockerHub.
          Hide
          recena Manuel Recena Soto added a comment -

          This bug is solved on *docker-build-publish-1.0*.

          Show
          recena Manuel Recena Soto added a comment - This bug is solved on * docker-build-publish-1.0 *.

            People

            • Assignee:
              recena Manuel Recena Soto
              Reporter:
              maneeshmp Maneesh M P
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: