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

Plugin does not use the docker registry URL from the docker-commons-plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If I understand the help of the Docker regitstry URL from the docker-commons-plugin correctly this should be used as default registry for all docker plugins based on the commons plugin. But it makes no difference if I specify this URL or not I must always specify our docker registry with a docker.withRegistry block.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          Cannot follow what you are talking about from this description. withRegistry affects DSL methods defined in this plugin inside its scope.

          Show
          jglick Jesse Glick added a comment - Cannot follow what you are talking about from this description. withRegistry affects DSL methods defined in this plugin inside its scope.
          Hide
          coderhugo Robin Müller added a comment -

          Well, I try to be a bit more specific what is the idea behind this issue:

          The docker-commons-plugin provides a section in the global configuration of the Jenkins where you can configure your default docker registry (= override docker hub). But this has no effect to any of the workflow steps provided by this plugin. To use a different different registry than docker hub you have to use the docker.withRegistry step of this plugin.

          In our case we have just one docker registry where all docker images that the Jenkins requires come from and the dockerd of the Jenkins doesn't have access to the internet at all which means no access to docker hub. At the moment we have to surround all our build steps that need a docker image with the same docker.withRegistry step again and again. In this case it would be nice if we could do this just by configuring our docker registry in the global configuration of the Jenkins and that's it.

          I hope this makes it more clear what's the intention behind this issue.

          Show
          coderhugo Robin Müller added a comment - Well, I try to be a bit more specific what is the idea behind this issue: The docker-commons-plugin provides a section in the global configuration of the Jenkins where you can configure your default docker registry (= override docker hub). But this has no effect to any of the workflow steps provided by this plugin. To use a different different registry than docker hub you have to use the docker.withRegistry step of this plugin. In our case we have just one docker registry where all docker images that the Jenkins requires come from and the dockerd of the Jenkins doesn't have access to the internet at all which means no access to docker hub. At the moment we have to surround all our build steps that need a docker image with the same docker.withRegistry step again and again. In this case it would be nice if we could do this just by configuring our docker registry in the global configuration of the Jenkins and that's it. I hope this makes it more clear what's the intention behind this issue.
          Hide
          jglick Jesse Glick added a comment -

           The docker-commons-plugin provides a section in the global configuration of the Jenkins where you can configure your default docker registry

          I am unaware of any such configuration option and cannot find it now in master sources of that plugin. Can you point me to the line of code (say, a *.jelly view) implementing what you describe?

          Show
          jglick Jesse Glick added a comment -  The docker-commons-plugin provides a section in the global configuration of the Jenkins where you can configure your default docker registry I am unaware of any such configuration option and cannot find it now in master sources of that plugin. Can you point me to the line of code (say, a *.jelly view) implementing what you describe?
          Hide
          coderhugo Robin Müller added a comment -

          The corresponding *.jelly view is this one .../DockerRegistryEndpoint/config.jelly and the corresponding help is here.

          Show
          coderhugo Robin Müller added a comment - The corresponding *.jelly view is this one .../DockerRegistryEndpoint/config.jelly  and the corresponding help is here .
          Hide
          jglick Jesse Glick added a comment -

          OK, but this is not in and of itself global configuration. It is used by docker-workflow only in Pipeline Syntax. From grepping Jenkins sources, I think you are looking at a config segment from pipeline-model-definition, which apparently (Andrew Bayer?) defines both global and folder-level configuration options including a registry location.

          At any rate, docker-workflow deliberately does not read any global configuration. If you want to share configuration, use a library, global environment variable, etc.; or use it implicitly via Declarative Pipeline.

          Show
          jglick Jesse Glick added a comment - OK, but this is not in and of itself global configuration. It is used by docker-workflow only in Pipeline Syntax . From grepping Jenkins sources, I think you are looking at a config segment from pipeline-model-definition , which apparently ( Andrew Bayer ?) defines both global and folder-level configuration options including a registry location. At any rate, docker-workflow deliberately does not read any global configuration. If you want to share configuration, use a library, global environment variable, etc.; or use it implicitly via Declarative Pipeline.
          Hide
          coderhugo Robin Müller added a comment -

          Ok, you are right. I just saw the heading (Pipeline Model Definition) for the docker registry URL right now. The reason why I thought this is part of the docker-commons-plugin was the help snippet of the URL which points to the docker-commons-plugin.

          We are already using a global workflow lib for our Jenkins. But we share this between 2 Jenkins instances: one for testing (changes of the library, updates of the Jenkins, etc) and one prod. Both Jenkins instances are using a different docker registry so we can't hard code this in the workflow lib. So we already use a global environment variable to use the correct docker registry. As I saw this global configuration I just thought this could make the whole setup a bit more nicer. My fault was just that I didn't realized that this configuration is part of the pipeline-model-definition.

          Nevertheless thanks for your help.

          Show
          coderhugo Robin Müller added a comment - Ok, you are right. I just saw the heading (Pipeline Model Definition) for the docker registry URL right now. The reason why I thought this is part of the docker-commons-plugin was the help snippet of the URL which points to the docker-commons-plugin . We are already using a global workflow lib for our Jenkins. But we share this between 2 Jenkins instances: one for testing (changes of the library, updates of the Jenkins, etc) and one prod. Both Jenkins instances are using a different docker registry so we can't hard code this in the workflow lib. So we already use a global environment variable to use the correct docker registry. As I saw this global configuration I just thought this could make the whole setup a bit more nicer. My fault was just that I didn't realized that this configuration is part of the pipeline-model-definition . Nevertheless thanks for your help.
          Hide
          jglick Jesse Glick added a comment -

          UX issue, not sure if there is a simple way to emphasize the scope of this configuration section.

          Show
          jglick Jesse Glick added a comment - UX issue, not sure if there is a simple way to emphasize the scope of this configuration section.

            People

            • Assignee:
              Unassigned
              Reporter:
              coderhugo Robin Müller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: