Docker, go modules and private repos
Go modules change the way we work with dependency not only locally but in Docker(CI) as well.
First problem we face is caching dependency. It resolves quite simple as docker layer:
When building an image, Docker steps through the instructions in your Dockerfile, executing each in the order specified. As each instruction is examined, Docker looks for an existing image in its cache that it can reuse, rather than creating a new (duplicate) image.
|
|
Looks like we are done. But only if you do not use private repo. If you do you see something like that: authentication failed
or repository not found
.
One additional step can help us:
|
|
You might want to use --local
config, but it leads to:
fatal: could not read Username for ‘https://github.com’: terminal prompts disabled
But with --global
it works fine