Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[post] Build go project with private dependency using docker multi stage build #38

Open
at15 opened this issue Sep 7, 2018 · 0 comments

Comments

@at15
Copy link
Member

at15 commented Sep 7, 2018

Type

  • request post from @at15

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 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.

Update

@at15 at15 self-assigned this Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant