title: Git inside docker inside Jenkins pipeline doesnt work
body: <p>I am trying to perform some git queries inside a docker container that runs as part of a Jenkins Pipeline.
  Out side the docker container the sshsgent is working fine and I can access my SCM no problem.  Inside the container I am getting host key verification issues.<br>
  Can anyone help with the mistake I have made?</p>
  
  <pre class="lang-groovy prettyprint-override"><code>script {
      sshagent(['e9f7d09a-7b88-4bf7-814c-464f811d9519'])
      {
          sh("""
              ssh -p 7999 git@bitbucket-eng-gpk1.com whoami
          """)
      }
      docker.withRegistry('https://dockerhub.banana.com', 'banana-dockerhub-credential') 
      {
          docker.image('banana_release_base').pull()
          docker.image('banana_release_base').inside(
          '''
             -v /system:/system -v /tmp:/tmp --privileged -u 0
          '''
         )
         {
               sshagent(['e9f7d09a-7b88-4bf7-814c-464f811d9519'])
               {
                   sh("""
                       echo $SSH_AUTH_SOCK
                       ssh -p 7999 git@bitbucket-eng-gpk1.com whoami
                   """)
               }
          }
      }
  }
  </code></pre>
  
  <p>First whoami call outputs:</p>
  
  <pre><code>[docker_git_test] Running shell script
  + ssh -p 7999 git@bitbucket-eng-gpk1.com whoami
  d42967b44abe31d6
  </code></pre>
  
  <p>Second call (and the echo) in the docker container outputs:</p>
  
  <pre><code>[docker_git_test] Running shell script
  + echo /tmp/ssh-dSoDZMggpAU1/agent.13
  /tmp/ssh-dSoDZMggpAU1/agent.13
  + ssh -p 7999 git@bitbucket-eng-gpk1.com whoami
  Host key verification failed
  </code></pre>