I am mirroring a popular go library in my organizations gitlab's group (for redundancy).
In my code I have:
import ( "gitlab.com/org/group/library.git" )
I used this answer for guidance on using go get with a private repository. On my machine
go get ./... works because I configured git using the following command:
$ git config --global firstname.lastname@example.org:.insteadOf https://gitlab.com/
When I try to build a docker container the command
RUN go get ./... fails with the following output:
package gitlab.com/org/group/library.git: cannot download, git://gitlab.com/org/group/library uses insecure protocol
It seems the popular answer from a similar thread or this article is to do something like upload your ssh keys to the docker container. I don't really feel comfortable with that because I don't exactly understand what is doing, or the security implications.
Any insight on how to properly configure my dockerfile or my golang work flow would be of great assistance.