I'm做碼頭工人,文件用下面的代碼:bitbucket docker權限被拒絕(publickey)。致命的:無法從遠程存儲庫中讀取
# 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 [email protected]: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
但是,當我建我得到了以下錯誤的文件:
Cloning into 'teste'... Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.x' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. The command '/bin/sh -c git clone [email protected]:xxxxxxxx/teste.git' returned a non-zero code: 128
我產生帶有PuTTY密鑰的id_rsa,並已存儲在bitbucket中。
任何人都可以幫忙嗎?
可以粘貼整個Dockerfile好嗎? – johnharris85
It's完整的文件,它只是有一個從Ubuntu的:16.04在它的頂部。 –
這就是我想知道的:) – johnharris85