title: Error pushing kaniko build image to azure container registry from jenkins groovy pipeline
body: <p>I have a scenario, I run my Jenkins in K8s cluster in Minikube. I run a groovy script within my Jenkins Pipeline which builds the docker image
  using <strong>Kaniko</strong> (which builds a docker image without docker daemon) and pushes to Azure container registry. I have created secret to authenticate to Azure. </p>
  
  <p>But when I push an image - I get an error </p>
  
  <pre><code> " [36mINFO[0m[0004] Taking snapshot of files...                  
  [36mINFO[0m[0004] ENTRYPOINT ["jenkins-slave"]                 
  error pushing image: failed to push to destination Testimage.azurecr.io/test:latest: unexpected end of JSON input
  [Pipeline] }"
  </code></pre>
  
  <p>My Script </p>
  
  <pre><code>My groovy script -- 
  
  def label = "kaniko-${UUID.randomUUID().toString()}"
  
  podTemplate(name: 'kaniko', label: label, yaml: """
  kind: Pod
  metadata:
    name: kaniko
  spec:
    containers:
    - name: kaniko
      image: gcr.io/kaniko-project/executor:debug
      imagePullPolicy: Always
      command:
      - /busybox/cat
      tty: true
      volumeMounts:
        - name: jenkins-pv
          mountPath: /root
    volumes:
    - name: jenkins-pv
      projected:
        sources:
        - secret:
            name: pass
            items:
              - key: .dockerconfigjson
                path: .docker/config.json
  """
    ) {
  
    node(label) {
      stage('Build with Kaniko') {
        git 'https://github.com/jenkinsci/docker-jnlp-slave.git'
        container(name: 'kaniko', shell: '/busybox/sh') {
            sh '''#!/busybox/sh
            /kaniko/executor -f `pwd`/Dockerfile -c `pwd` --skip-tls-verify --destination=testimage.azurecr.io/test:latest
            '''
        }
      }
    }
  }
  </code></pre>
  
  <p>Could you please help how to overcome the error? And also :</p>
  
  <ul>
  <li>How do I know the name of the image build by kaiko?</li>
  <li>I m just pushing like - registry.acr.io/<strong>test</strong>: latest, probably it's an incorrect image name that's the reason I get JSON output error?</li>
  </ul>