dum3ng / study-issues

0 stars 0 forks source link

setup ssh key to fetch private repo in docker #31

Closed dum3ng closed 4 years ago

dum3ng commented 4 years ago

in Dockerfile:

RUN mkdir -p /root/.ssh && touch ~/.ssh/known_hosts
COPY gitlab_key  /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa 

RUN eval $(ssh-agent) && \
    ssh-add /root/.ssh/id_rsa && \
    ssh-keyscan -H gitlab.com >> /etc/ssh/ssh_known_hosts