My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How to pull from private repo (GitLab) with Docker?

Emil Moe's photo
Emil Moe
·Feb 14, 2018

I am creating an automated Docker setup for my website. One step is to pull the data from GitLab, but this is a private repo and should not be shared with anyone therefor I hesitate to just add a deploy key directly in my Dockerfile.

Any good suggestions how I tackle this problem?

It's going to be hosted on AWS with an API call, so maybe there are some options here? Maybe I can use the environment keys? But how would I add the multiline private key? The public key isn't that necessary I guess. And how does it look in my Dockerfile to extract that variable?