Loading private Github repositories

I’m running into issues with getting my docker image to import a private repository from Github using a personal access token. My dockerfile includes:

RUN git clone -b docker https://<token>:x-oauth-basic@github.com/user/repo.git /repo/

When I remove the git clone command and remove the relevant import statements I’m able to successfully build the image. Can anybody give me tips on how to successfully automate the importing of private github repositories?

2 Likes