2018-10-30 09:27
浏览 685


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 url.git@gitlab.com:.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.

图片转代码服务由CSDN问答提供 功能建议

我正在镜像我的组织gitlab组中一个流行的go库(出于冗余目的)。 \ n

在我的代码中,我有: import(“ gitlab.com/org/group/library.git”)

我使用了此答案有关在私有存储库中使用go get的指导。 在我的机器上, go get ./...可以工作,因为我使用以下命令配置了git:

  $ git config --global url.git  @ gitlab.com:.insteadOf https://gitlab.com/

当我尝试构建docker容器时,命令 RUN进入get ./ ... 失败,并显示以下输出:

  package gitlab.com/org/group/library.git:无法下载,git://gitlab.com  / org / group / library使用不安全的协议

这似乎是类似线程本文的作用是将ssh密钥上传到docker容器。 我对此不太满意,因为我不完全了解正在执行的操作或安全隐患。


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题