Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
- fatal: Could not read from remote repository.
- docker build . --build-arg priv_key="$(cat ~/.ssh/id_rsa)" --build-arg pub_key="$(cat ~/.ssh/id_rsa.pub)"
- FROM centos/python-35-centos7:latest
- USER root
- ARG pub_key
- ARG priv_key
- RUN mkdir -p /root/.ssh/
- RUN chmod 0700 /root/.ssh/
- RUN echo ${pub_key} >> /root/.ssh/id_rsa.pub
- RUN chmod 600 /root/.ssh/id_rsa.pub
- RUN echo ${priv_key} >> /root/.ssh/id_rsa
- RUN chmod 600 /root/.ssh/id_rsa
- RUN git config --global user.name "A name"
- RUN git config --global user.email "email@address.com"
- RUN echo "Host 192.168.1.28ntPasswordAuthentication non" >> /root/.ssh/config
- RUN chmod 600 /root/.ssh/config
- RUN ssh-keyscan -t rsa 192.168.1.28 >> /root/.ssh/known_hosts
- RUN ssh -Tv git@192.168.1.28
- debug1: Next authentication method: publickey
- debug1: Offering RSA public key: /root/.ssh/id_rsa
- debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
- debug1: read_passphrase: can't open /dev/tty: No such device or address
- debug1: Trying private key: /root/.ssh/id_dsa
- debug1: Trying private key: /root/.ssh/id_ecdsa
- debug1: Trying private key: /root/.ssh/id_ed25519
- debug1: Next authentication method: publickey
- debug1: Offering RSA public key: /root/.ssh/id_rsa
- debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
- debug1: Authentication succeeded (publickey).
- Authenticated to 192.168.1.28 ([192.168.1.28]:22).
- FROM ubuntu as intermediate > FROM centos:7
- apt-get update > yum update
- apt-get install -y git > yum install -y git
- FROM centos/python-35-centos7:latest
- #FROM centos:7
- USER root
- RUN yum update -y
- RUN yum install -y git
- ARG SSH_PRIVATE_KEY
- RUN mkdir /root/.ssh/
- RUN echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa
- RUN chmod 600 /root/.ssh/id_rsa
- RUN touch /root/.ssh/known_hosts
- RUN ssh-keyscan 192.168.1.28 >> /root/.ssh/known_hosts
- RUN ssh -Tv git@192.168.1.28
Add Comment
Please, Sign In to add comment