Alo*_*wal 2 github docker dockerfile
我是docker的新手,所以尝试了所有基本的东西.
我使用了以下dockerfile来生成我的工作泊坞窗图像
FROM ubuntu:14.04
MAINTAINER Alok Agarwal "alok.alok.com"
RUN apt-get update
#Install git
RUN apt-get install -y git
RUN mkdir -p /root/.ssh/
ADD id_rsa /root/.ssh/id_rsa
RUN touch /root/.ssh/known_hosts
RUN chmod 700 /root/.ssh/id_rsa
RUN git clone git@github.com:user/user.git
EXPOSE 80
Run Code Online (Sandbox Code Playgroud)
我可以使用ssh在我的本地系统中克隆我的repo,但是当它从docker做它的时候
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我把我的id_rsa文件放在我的dockerfile所在的同一个地方,但仍然不知道它为什么会一直失败.
我错过了任何基本步骤.
预付谢谢你的时间
看看我的例子,我有一个私人 ssh在我的目录关键dockerize应用(应用ssh_keys/id_rsa),以及公共密钥我已经上传到私人回购协议:
FROM ubuntu:14.04
MAINTAINER Alok Agarwal "alok.alok.com"
RUN apt-get update
#Install git
RUN apt-get install -y git
RUN /bin/bash -l -c "mkdir /root/.ssh"
ADD ssh_keys/id_rsa /root/.ssh/id_rsa
RUN chmod 700 /root/.ssh/id_rsa
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
RUN mkdir -p /www/app
RUN git clone git@github.com:my_private_repo/repo.git /www/app
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1922 次 |
| 最近记录: |