我正在使用以下代码创建一个docker文件:
# Update aptitude with new repo
RUN apt-get update
# Install software
RUN apt-get install -y git
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
ADD id_rsa /root/.ssh/id_rsa
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Add bitbuckets key
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
RUN chgrp 545 ~/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
# Clone the conf files into the docker container
RUN git clone git@bitbucket.org:xxxxxx/teste.git
RUN cd teste echo "# My project's README" >> README.md
RUN git add README.md
RUN git commit -m "Initial commit"
RUN git push -u origin master
但是当我构建文件时,我收到以下错误:
克隆到'teste'...警告:永久添加RSA主机密钥 将IP地址'xxx.xxx.xxx.x'添加到已知主机列表中。允许 否认(公钥)。致命的:无法从远程存储库读取。
请确保您拥有正确的访问权限和存储库 存在。命令'/ bin / sh -c git clone git@bitbucket.org:xxxxxxxx/teste.git'返回非零代码: 128
我使用PuTTY key gen生成了id_rsa,并且已经存储在bitbucket中。
任何人都可以提供帮助吗?