我使用coding.net创建了私有代码仓库。
我使用的docker镜像为alpine和centos。
我可以从docker-centos顺利获取git.coding.net/alphayan/orionv2.git
,但是无法从docker-alpine中获取git.coding.net/alphayan/test.git
。它返回一个错误信息:
/go/src # go get -u -v git.coding.net/alphayan/test.git
# cd .; git ls-remote https://git.coding.net/alphayan/test
fatal: could not read Username for 'https://git.coding.net': terminal prompts disabled
# cd .; git ls-remote git+ssh://git.coding.net/alphayan/test
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
# cd .; git ls-remote ssh://git.coding.net/alphayan/test
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
package git.coding.net/alphayan/test.git: cannot download, git.coding.net/alphayan/test uses insecure protocol
从CentOS中,它让我使用用户名和密码:
[root@83fc8067fc95 /]# go get -u -v git.coding.net/alphayan/test.git
Username for 'https://git.coding.net':
最后,我发现这是由git的版本引起的问题。CentOS使用的是git 1.8.3,而alpine使用的是git 2.11.0。
然后我将CentOS的git版本更改为2.11.0,结果与alpine一样出错了。
我认为我可以修改golang或git源文件来解决这个问题,有人能帮忙吗?谢谢~!