Skip to content

Instantly share code, notes, and snippets.

@stanlee321
Created September 10, 2020 05:12
Show Gist options
  • Save stanlee321/ca9899bdd3f0df3c819b2c6740bcd9ce to your computer and use it in GitHub Desktop.
Save stanlee321/ca9899bdd3f0df3c819b2c6740bcd9ce to your computer and use it in GitHub Desktop.
docker-golang-private-repos
FROM golang
RUN apt-get update && apt-get install -y ca-certificates git-core ssh
ADD keys/my_key_rsa /root/.ssh/id_rsa
RUN chmod 700 /root/.ssh/id_rsa
RUN echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /root/.ssh/config
RUN git config --global url.ssh://[email protected]/.insteadOf https://github.com/
ADD . /go/src/github.com/myaccount/myprivaterepo
RUN go get github.com/myaccount/myprivaterepo
RUN go install github.com/myaccount/myprivaterepo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment