Spent one day at work writing Dockerfile and Makefile. The code at work relies on many internal projects, on Jenkins, the Jenkins worker has access to all internal GithHub projects, however if I use a fully dockerized build locally and get vendor using glide install or dep install, it will fail because no access. The solution is to add ssh private key into container when build, and by using multi stage build, the build image is discarded right away and the runner image does not contain credentials.
Also had some interesting stuff like need to base64 encode and decode private key content, chmod 0400 ~/.ssh/id_rsa, add known host.
Type
Related
Description
Spent one day at work writing Dockerfile and Makefile. The code at work relies on many internal projects, on Jenkins, the Jenkins worker has access to all internal GithHub projects, however if I use a fully dockerized build locally and get vendor using
glide install
ordep install
, it will fail because no access. The solution is to add ssh private key into container when build, and by using multi stage build, the build image is discarded right away and the runner image does not contain credentials.Also had some interesting stuff like need to base64 encode and decode private key content, chmod 0400 ~/.ssh/id_rsa, add known host.
Update