Skip to content

Instantly share code, notes, and snippets.

@skatsuta
Last active October 23, 2015 10:36
Show Gist options
  • Save skatsuta/0f0c24f45c923f316b12 to your computer and use it in GitHub Desktop.
Save skatsuta/0f0c24f45c923f316b12 to your computer and use it in GitHub Desktop.
Sample Dockerfile that uses a private repository to build
FROM google/golang
RUN apt-get update -y && \
apt-get install -y ca-certificates git-core ssh
ADD id_rsa /root/.ssh/id_rsa
RUN chmod 400 /root/.ssh/id_rsa
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
RUN git config --global url.ssh://git@github.com/.insteadOf https://github.com/
CMD ["echo", "Hello, World"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment