DEV Community

Discussion on: Working with private repos in Docker

Collapse
 
hellovietduc profile image
Duc Nguyen

My recommendation is to use multi-stage builds. You could have stage 1 where you copy your SSH key to install the private dependencies, and stage 2 where you copy the dependencies needed to build the app. Google it and you'll find many tutorials.

Collapse
 
cambiph profile image
cambiph

True, but then I would have to have the SSH-key and .npmrc in my version control system which is also a risk.