Dockerfile can't find my private ssh key

apache, docker, ssh

Solution

Is your `id_rsa` file in the current directory where your Dockerfile is? Try specifying the full path to it

Problem

I'm trying to build a dockerfile so that it clones a private repo. I've believe I've added the right code to do this, but it keeps throwing this error: ``` build: id_rsa: no such file or directory ``` I've made sure the path is right and that the key is in there, and tried numerous other solutions proposed on here such as uncommenting the IdentityFile in ssh_config to no avail. Here is my dockerfile: ``` FROM ubuntu:latest MAINTAINER John Fink <john.fink@gmail.com> RUN apt-get update # Thu Nov 7 22:40:44 EST 2013 RUN apt-get install -y mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql git RUN easy_install supervisor ADD id_rsa /root/.ssh/id_rsa ADD known_hosts /root/.ssh/known_hosts RUN echo " IdentityFile /root/.ssh/id_rsa" >> /etc/ssh/ssh_config RUN cd /var/www RUN git clone git@dev.ploonky.com:eric/hartshorn-portraiture.git ADD ./start.sh /start.sh ADD ./foreground.sh /etc/apache2/foreground.sh ADD ./supervisord.conf /etc/supervisord.conf RUN chmod 755 /start.sh RUN chmod 755 /etc/apache2/foreground.sh EXPOSE 80 CMD ["/bin/bash", "/start.sh"] ```

Original source