title: Jenkins Scripted Pipeline Job failing for docker login
body: <pre><code>Jenkins Version - 2.164.1
  Jenkins Docker Plugin Version – 1.1.6
  Docker Version - 18.09.3, build 774a1f4
  </code></pre>
  
  <p><strong>Problem:-</strong></p>
  
  <p>I have below code in my Jenkins scripted pipeline section. I have added my private Docker registry URL and Credentials added under Manage Jenkins --> Configure System. But pipeline Job is failing for docker login.</p>
  
  <blockquote>
    <p>Error form Jenkins - <code>ERROR: docker login failed</code></p>
  </blockquote>
  
  <p><strong>Code:-</strong></p>
  
  <pre><code>stage('Build') { 
    withDockerRegistry(credentialsId: 'docker-reg-credentails', url: 'http://registryhub:8081/nexus/') {
      image = docker.image('registryhub:8085/ubuntu-16:1')
      image.pull()
      docker.image('registryhub:8085/ubuntu-16:1').inside {   
        sh 'cat /etc/issue'
      }
    }
  }
  </code></pre>