I met this problem long time ago and can not solve it at all. Can anyone give me some help?
I created a docker container, and then inside docker, I want to clone an internal git repository:
git clone [email protected]:ngcsc/ngcsc.git
And I got this error:
ssh: connect to host git.xxx.net port 22: No route to host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If I use curl https://git.xxx.net, I also met error:
curl: (7) Failed connect to git.xxx.net:443; No route to host
I can curl other https website, such as curl https://www.google.com
I don't know why some internal website can be reached inside docker, some not. Any suggestions are appreciated
I think since you are using the ssh url for git clone, you would have generate a ssh key and register the same on the git portal.
GitHub ssh registration
Then you would have to include the ssh key inside the docker container and do ssh-add keyfile
Hope this solves your problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With