【发布时间】:2014-02-25 16:36:12
【问题描述】:
我正在尝试构建一个 dockerfile,以便它克隆一个私有 repo。我相信我已经添加了正确的代码来执行此操作,但它一直抛出此错误:
build: id_rsa: no such file or directory
我已确保路径正确且密钥在其中,并尝试了此处提出的许多其他解决方案,例如取消注释 ssh_config 中的 IdentityFile 无济于事。这是我的 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"]
【问题讨论】:
-
你知道
/root/.ssh目录存在于ADD id_rsa /root/.ssh/id_rsa这一行之前吗?