Skip to content

Instantly share code, notes, and snippets.

@aaronhenshaw
Created August 20, 2015 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronhenshaw/5dbf98d4ba915896cd2d to your computer and use it in GitHub Desktop.
Save aaronhenshaw/5dbf98d4ba915896cd2d to your computer and use it in GitHub Desktop.
#######################
### SSH KEYS FOR GITHUB
#######################
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
ADD github_rsa /root/.ssh/id_rsa
ADD github_rsa.pub /root/.ssh/id_rsa.pub
RUN echo "IdentityFile /root/.ssh/id_rsa" >> /etc/ssh/ssh_config
RUN ssh-keygen -lf /root/.ssh/id_rsa
RUN chmod 600 /root/.ssh/id_rsa
# Create known_hosts, add github.com
RUN touch /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
#############
### PULL REPO
#############
ENV PROJECT_HOME /project_home/
RUN mkdir ${PROJECT_HOME}
RUN git clone git@github.com:Company/repo.git ${PROJECT_HOME}/app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment