title: Docker container build with git ssh access, Load key "/root/.ssh/id_rsa": invalid format
body: <p>Folks,
    After following a few threads on how to add ssh keys to the docker container for the application build phase, I am getting an interesting error:</p>
  
  <pre><code>Load key "/root/.ssh/id_rsa": invalid format
  </code></pre>
  
  <p>My Dockerfile:</p>
  
  <pre><code>RUN mkdir /root/.ssh/
  ADD serviceBitbucketKey.ssh /root/.ssh/id_rsa
  RUN chmod 400 /root/.ssh/id_rsa
  
  RUN touch /root/.ssh/`known_hosts
  RUN ssh-keyscan bitbucket.org &gt;&gt; /root/.ssh/known_hosts
  RUN git ls-remote git@bitbucket.org:orgName/repo.git
  RUN git config --global url.ssh://git@bitbucket.org/.insteadOf https://bitbucket.org/
  </code></pre>
  
  <p>I do know the key is fine... it was generated via</p>
  
  <pre><code>ssh-keygen -t rsa -b 4096 -f serviceBitbucketKey.ssh
  </code></pre>
  
  <p>Suggestions?  Thanks!</p>