building ci


Author: yifei / Created: July 5, 2017, 5:59 p.m. / Modified: July 5, 2017, 6:02 p.m. / Edit

生成 deploy_key: ssh-keygen -q -t rsa -N '' -f KEY_FILE

添加到 docker:

COPY KEY_FILE /
RUN \
  chmod 600 /KEY_FILE && \  
  echo "IdentityFile /KEY_FILE" >> /etc/ssh/ssh_config && \  
  echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config

把 KEY_FILE.pub 添加到 github 项目的 deploy keys

参见:https://stackoverflow.com/questions/23391839/clone-private-git-repo-with-dockerfile


有任何问题可以发邮件到 kongyifei (at) gmail.com 讨论