我在码头上运行gerrit。我从dockerhub得到了图像。我这样运行:
docker run -it -p 8080:8080 -p 29418:29418 --rm
-e AUTH_TYPE='DEVELOPMENT_BECOME_ANY_ACCOUNT'
-v /home/gerrit-site:/home/gerrit/site
-v /root/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub
-v /root/.ssh/id_rsa:/root/.ssh/id_rsa
-v /home/accounts/ssh-keys/:/home/gerrit/ssh-keys
--name gerrit docker.io/fabric8/gerrit:latest
图像正在运行,我可以通过URL访问它,即ip:8080。当我尝试通过http创建的任何项目时,它可以工作,我在主机上获得克隆的回购。但是当我尝试通过ssh克隆时,我收到以下错误,
Cloning into 'project'...
ssh: connect to host host_ip port 29418: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
后来我也尝试过,将我的主机ssh密钥添加到gerrit中并尝试克隆但没有成功。
当我尝试使用ssh ip:29418时,
ssh: Could not resolve hostname ip:29418: Name or service not known
我不知道我哪里出错了,需要一些指导。