192.168.59.103 is typical of a boot2docker ip, that is the IP of the VirtualBox machine which hosts the Tiny core Linux running the containers (the ones with the 172.17.0.13)
If you want to access any ports from a client, you need to make sure:
- the GitLab container runs with the exposed ports mapped to ports in the Linux host:
docker run -p 2222:22 -p 80:80 -p 443:443 ...
- those ports are redirected in the VirtualBox network definition of "
boot2docker-vm
" defined in it:
That would be for example:
boot2docker stop
VBoxManage.exe controlvm "boot2docker-vm" natpf1 "udp-port80,udp,,80,,80";
VBoxManage.exe controlvm "boot2docker-vm" natpf1 "udp-port80,udp,,443,,443";
(same for 443, 2222 should already be exported)
Otherwise, a client (outside of the VirtualBox) wouldn't be able to see those ports when accessing 192.168.59.103.
In the OP case, no need for 192.168.59.103. The IP of the RedHat server is enough (since it directly hosts the docker service).
ssh -p 2222 10.137.20.113
would only work with the right user (git)
ssh -p 2222 git@10.137.20.113
And only if the public ssh key has been registered on the server.
The OP reports in the comments having the error:
git-upload-pack '2222:root/test.git'
I fix the problem in 2 steps:
- add Port
2222
in ~/.ssh/config
- Use
git clone git@10.137.20.113:root/test.git
You can see a more complete example of ~/.ssh/config
in "git clone
using ssh failed in Windows due to permission issue".
After testing, this also work:
git clone ssh://git@10.137.20.113:2222/root/test.git
(so using '/
' instead of ':
')