我使用 AWS ec2 实例作为私有 git 存储库。该实例还用于运行 Dockerfile,并且 docker file 尝试从该私有存储库中检出代码。我的基本设置是按照https://alvinabad.wordpress.com/2013/03/23/how-to-specify-an-ssh-key-file-with-the-git-command/选项 2 完成的。但是,当我运行我的 docker build 命令时:
$ sudo docker build -t "spring-petclinic" 。
构建脚本在以下行停止:
运行 /root/.ssh/git.sh -i /root/.ssh/.pem 克隆 ec2-user@ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com:/usr/local/git-存储库/spring-petclinic.git
并得到以下错误:
“克隆到'spring-petclinic'...主机密钥验证失败。致命:无法从远程存储库读取。请确保您具有正确的访问权限并且存储库存在。”
我已经通过谷歌搜索这种类型的错误,类似的设置,但无法搜索。
请帮忙!!!
谢谢