Fetching git behind proxy in docker container

两盒软妹~` 提交于 2019-12-06 11:47:46

Fetching git://github.com/seuros/state_machine.git: this is not https protocol.
It is the Git one (on port 9418 by default)

Add to your Dockerfile (before git clone):

RUN git config --global url."https://github.com/".insteadOf git@github.com:

That way, you know git will use an https url, and will benefit from the https proxy you have set up.

Thanks to @VonC for pointing me in the right direction

Here is the solution to fix the problem for Github

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

For bit bucket:

git config --global url."https://user:pass@bitbucket.org".insteadOf   ssh://git@bitbucket.org
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!