我正在嘗試構建一個dockerfile,以便它克隆私人回購。我一直相信,我已經添加了正確的代碼要做到這一點,但它不斷拋出這個錯誤:Dockerfile無法找到我的私人ssh密鑰
build: id_rsa: no such file or directory
我做了一定的路徑是正確的,關鍵是在那裏,並試圖許多其他在這裏提出的解決方案,例如取消註釋ssh_config中的IdentityFile無濟於事。這裏是我的dockerfile:
FROM ubuntu:latest
MAINTAINER John Fink <[email protected]>
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 [email protected]: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"]
你知道'/ root/.ssh'目錄存在於'ADD id_rsa/root/.ssh/id_rsa'行之前嗎? –