I am new to docker, so was trying all basic stuff.
I have used following dockerfile to generate my working docker images
FROM ubuntu:14.04
MAINTAINER Alok Agarwal "alok.alok.com"
RUN apt-get update
#Install git
RUN apt-get install -y git
RUN mkdir -p /root/.ssh/
ADD id_rsa /root/.ssh/id_rsa
RUN touch /root/.ssh/known_hosts
RUN chmod 700 /root/.ssh/id_rsa
RUN git clone [email protected]:user/user.git
EXPOSE 80
I am able to clone my repo in my local system using ssh but when doing from docker its giving
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I have put my id_rsa file same place where my dockerfile reside but still doesnt know why it is continuously failing.
Am I missing any basic step.
Advance Thanks for your time
Look at my example, I have a private
ssh
key in the directory where Idockerize
app(ssh_keys/id_rsa
), and public key I have already upload to the private repo: