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

"Registry credentials" is not working with a private docker registry

        [JENKINS-39952] "Registry credentials" is not working with a private docker registry

        The screenshot was outdated, configuration is done in each job

        Carlos Sanchez added a comment - The screenshot was outdated, configuration is done in each job

        Carlos Sanchez added a comment - There are more docs linked to https://go.cloudbees.com/docs/cloudbees-documentation/cje-user-guide/chapter-docker-build-publish.html

        Chi added a comment -

        Thanks Carlos!
        If this is true, the "Registry credentials" is not working with a private docker registry. The error message is pasted below.

        $ docker push ****.io/docker-abc
        The push refers to a repository [****]
        4f77f877cd62: Preparing
        290efca864d1: Preparing
        a93e5549dca1: Preparing
        0459986018de: Preparing
        no basic auth credentials

        Chi added a comment - Thanks Carlos! If this is true, the "Registry credentials" is not working with a private docker registry. The error message is pasted below. $ docker push ****.io/docker-abc The push refers to a repository [****] 4f77f877cd62: Preparing 290efca864d1: Preparing a93e5549dca1: Preparing 0459986018de: Preparing no basic auth credentials

        Chi added a comment -

        Follow up with my question, and change the issue title accordingly.
        Thanks for helping!

        Chi added a comment - Follow up with my question, and change the issue title accordingly. Thanks for helping!

        Ryan Currah added a comment - - edited

        We thought we could use it for our private registry turns out this is not the case. As Jenkins Enterprise customers we would love to be able to specify which registry the credentials are for.

        Ryan Currah added a comment - - edited We thought we could use it for our private registry turns out this is not the case. As Jenkins Enterprise customers we would love to be able to specify which registry the credentials are for.

        Ryan Currah added a comment - - edited

        Another issue is that users keep selecting this option with invalid credentials and it breaks builds. Because it writes a docker credentials file to /home/jenkins/.dockercfg with bad credentials. No one can pull from docker.io because we are getting auth errors against docker.io in all the jobs now. Everyone who uses that build slave cant pull images because of one person's misconfiguration ina job. Is there some less persistent way to insert the credentials on a per job basis?

        Ryan Currah added a comment - - edited Another issue is that users keep selecting this option with invalid credentials and it breaks builds. Because it writes a docker credentials file to /home/jenkins/.dockercfg with bad credentials. No one can pull from docker.io because we are getting auth errors against docker.io in all the jobs now. Everyone who uses that build slave cant pull images because of one person's misconfiguration ina job. Is there some less persistent way to insert the credentials on a per job basis?

        Tenyo Grozev added a comment -

        The registry authentication stopped working for us after we upgraded from Docker 1.10 to 1.12, which now uses exclusively .docker/config.json instead of .dockercfg. This plugin only generates .dockercfg. As a workaround, I've logged in locally on the Docker host to generate the config.json.

        Tenyo Grozev added a comment - The registry authentication stopped working for us after we upgraded from Docker 1.10 to 1.12, which now uses exclusively .docker/config.json instead of .dockercfg. This plugin only generates .dockercfg. As a workaround, I've logged in locally on the Docker host to generate the config.json.

        I went on for hours in circles just to fix this at the end by adding an execute shell step to do the following:

        mv ~/.dockercfg ~/.dockercfg.old

        This fixed my issue.

        Thanks ryancurrah for pointing out the exact issue with this file.

        Rehab Hassanein added a comment - I went on for hours in circles just to fix this at the end by adding an execute shell step to do the following: mv ~/.dockercfg ~/.dockercfg.old This fixed my issue. Thanks ryancurrah for pointing out the exact issue with this file.

        Bruno Meneguello added a comment - - edited

        I'm using this with Kubernetes cloud and a docker-dind image.
        I just succeeded by adding a shell step with docker login ... before the step.

        Bruno Meneguello added a comment - - edited I'm using this with Kubernetes cloud and a docker-dind image. I just succeeded by adding a shell step with docker login ... before the step.

          csanchez Carlos Sanchez
          nkcfan Chi
          Votes:
          5 Vote for this issue
          Watchers:
          8 Start watching this issue

            Created:
            Updated: