Guest User

Untitled

a guest
Jun 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
  2. fatal: Could not read from remote repository.
  3.  
  4. docker build . --build-arg priv_key="$(cat ~/.ssh/id_rsa)" --build-arg pub_key="$(cat ~/.ssh/id_rsa.pub)"
  5.  
  6. FROM centos/python-35-centos7:latest
  7. USER root
  8. ARG pub_key
  9. ARG priv_key
  10. RUN mkdir -p /root/.ssh/
  11. RUN chmod 0700 /root/.ssh/
  12. RUN echo ${pub_key} >> /root/.ssh/id_rsa.pub
  13. RUN chmod 600 /root/.ssh/id_rsa.pub
  14. RUN echo ${priv_key} >> /root/.ssh/id_rsa
  15. RUN chmod 600 /root/.ssh/id_rsa
  16. RUN git config --global user.name "A name"
  17. RUN git config --global user.email "email@address.com"
  18. RUN echo "Host 192.168.1.28ntPasswordAuthentication non" >> /root/.ssh/config
  19. RUN chmod 600 /root/.ssh/config
  20. RUN ssh-keyscan -t rsa 192.168.1.28 >> /root/.ssh/known_hosts
  21. RUN ssh -Tv git@192.168.1.28
  22.  
  23. debug1: Next authentication method: publickey
  24. debug1: Offering RSA public key: /root/.ssh/id_rsa
  25. debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
  26. debug1: read_passphrase: can't open /dev/tty: No such device or address
  27. debug1: Trying private key: /root/.ssh/id_dsa
  28. debug1: Trying private key: /root/.ssh/id_ecdsa
  29. debug1: Trying private key: /root/.ssh/id_ed25519
  30.  
  31. debug1: Next authentication method: publickey
  32. debug1: Offering RSA public key: /root/.ssh/id_rsa
  33. debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
  34. debug1: Authentication succeeded (publickey).
  35. Authenticated to 192.168.1.28 ([192.168.1.28]:22).
  36.  
  37. FROM ubuntu as intermediate > FROM centos:7
  38. apt-get update > yum update
  39. apt-get install -y git > yum install -y git
  40.  
  41. FROM centos/python-35-centos7:latest
  42. #FROM centos:7
  43. USER root
  44. RUN yum update -y
  45. RUN yum install -y git
  46. ARG SSH_PRIVATE_KEY
  47. RUN mkdir /root/.ssh/
  48. RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
  49. RUN chmod 600 /root/.ssh/id_rsa
  50. RUN touch /root/.ssh/known_hosts
  51. RUN ssh-keyscan 192.168.1.28 >> /root/.ssh/known_hosts
  52. RUN ssh -Tv git@192.168.1.28
Add Comment
Please, Sign In to add comment