Skip to content

Instantly share code, notes, and snippets.

@Elergy
Created February 24, 2015 11:43
Show Gist options
  • Save Elergy/781c2786a95d3714f890 to your computer and use it in GitHub Desktop.
Save Elergy/781c2786a95d3714f890 to your computer and use it in GitHub Desktop.
Clone from private repo
FROM <smt>
MAINTAINER <smo>
RUN apt-get update
# Install software
RUN apt-get install -y git
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
ADD id_rsa /root/.ssh/id_rsa
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Add bitbuckets key
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
# Clone the conf files into the docker container
RUN git clone git@bitbucket.org:User/repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment