title: Using SSH keys inside docker container
body: <p>I have an app that executes various fun stuff with Git (like running git clone &amp; git push) and I'm trying to docker-ize it.</p>
  
  <p>I'm running into an issue though where I need to be able to add an SSH key to the container for the container 'user' to use.</p>
  
  <p>I tried copying it into <code>/root/.ssh/</code>, changing <code>$HOME</code>, creating a git ssh wrapper, and still no luck. </p>
  
  <p>Here is the Dockerfile for reference:</p>
  
  <pre><code>#DOCKER-VERSION 0.3.4                                                           
  
  from  ubuntu:12.04                                                              
  
  RUN  apt-get update                                                             
  RUN  apt-get install python-software-properties python g++ make git-core openssh-server -y
  RUN  add-apt-repository ppa:chris-lea/node.js                                   
  RUN  echo "deb http://archive.ubuntu.com/ubuntu precise universe" &gt;&gt; /etc/apt/sources.list
  RUN  apt-get update                                                             
  RUN  apt-get install nodejs -y                                                  
  
  ADD . /src                                                                       
  ADD ../../home/ubuntu/.ssh/id_rsa /root/.ssh/id_rsa                             
  RUN   cd /src; npm install                                                      
  
  EXPOSE  808:808                                                                 
  
  CMD   [ "node", "/src/app.js"]
  </code></pre>
  
  <p><code>app.js</code> runs the git commands like <code>git pull</code></p>