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

Use docker images from private registry

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using an agent directive in Declarative Pipeline there is no way to specify the Docker Registry to use. In Scripted Pipline this is available via the withRegistry wrapper

      docker.withRegistry('https://docker.mycorp.com/', 'docker-login') {
        git '…'
        docker.build('myapp').push('latest')
      }
      

      For Declarative we should allow admins to create a default registry to be used by all Pipelines at the master level or the folder level. We should also allow a specific registry setting in the language itself via the agent directive.

        Attachments

          Issue Links

            Activity

            Hide
            pleibiger Peter Leibiger added a comment -

            Works for me.

            Show
            pleibiger Peter Leibiger added a comment - Works for me.
            Hide
            rocketeer125 Tom Bamford added a comment - - edited

            For the benefit of anyone else who discovers this in future wondering what the syntax should actually look like altogether, example given below:

             

            agent {
              docker {
                label 'docker'
                image 'myregistry.com/node:7.10.0'
                registryUrl 'https://myregistry.com/'
                registryCredentialsId 'myPredefinedCredentialsInJenkins'
              }
            }
            
            Show
            rocketeer125 Tom Bamford added a comment - - edited For the benefit of anyone else who discovers this in future wondering what the syntax should actually look like altogether, example given below:   agent {   docker {     label 'docker'     image 'myregistry.com/node:7.10.0'     registryUrl 'https: //myregistry.com/'     registryCredentialsId 'myPredefinedCredentialsInJenkins'   } }
            Hide
            jouve Cyril Jouve added a comment -
            Show
            jouve Cyril Jouve added a comment - Hello, this is a great feature but I could not find documentation/exemple. I looked here: https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki https://jenkins.io/doc/ https://www.google.fr/search?q=jenkins+pipeline+additionalBuildArgs  
            Hide
            jraub_switch Jordan Raub added a comment - - edited

            The resolved dependent issue (JENKINS-40524) does add the registryUrl and registryCredentialsId, but what is the mechanism to push a tag into the registry upon success?

            Show
            jraub_switch Jordan Raub added a comment - - edited The resolved dependent issue ( JENKINS-40524 ) does add the registryUrl and registryCredentialsId, but what is the mechanism to push a tag into the registry upon success?
            Hide
            abayer Andrew Bayer added a comment -

            Jordan Raub Feel free to open a new issue for that.

            Show
            abayer Andrew Bayer added a comment - Jordan Raub Feel free to open a new issue for that.

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                hrmpw Patrick Wolf
              • Votes:
                1 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: