I'm trying to clone a private repo from github using Docker. The problem is that I need to use ssh to access to that repo. I added a key in my github project's setting which is used, I suppose, to identify the docker's server.
My problem is that I can't figure out what I should write in my Dockerfile so that the server use that key when it tries to access to my github repo. I saw examples where id_rsa is added to the container, but I don't know where id_rsa is stored on their server, if it exists
RUN mkdir /root/.ssh/
# can't find the file id_rsa
ADD id_rsa /root/.ssh/id_rsa
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
run git clone [email protected]:user/repo.git
How do I access to my private repo from docker's server ?