環境配置:centos7+docker+gitlab
一、出現的問題
ssh配置成功,本地拉取gitlab項目報錯
lucky@luckydeMacBook-Pro ~ % git clone git@81ca3f292881:Syw/daas_interface_test.git Cloning into 'daas_interface_test'... ssh: Could not resolve hostname 81ca3f292881: nodename nor servname provided, or not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. lucky@luckydeMacBook-Pro ~ %
注:快速的處理方案:將81ca3f292881 改為172.16.58.134:8070(gitlab的地址)即可clone成功
注意:當gitlab新創建項目時,項目地址會自動獲取一個gitlab服務器的IP地址
二、解決方法:(修改這個IP地址,讓其成為正確的IP地址)
1、登錄服務器(這里我是自己的虛擬機)
2、打開終端,進入docker容器,在容器中執行執行命令
docker exec -it gitlab1 bash
3、進入到gitlab的配置文件中
cd /opt/gitlab/embedded/service/gitlab-rails/config
4、修改 gitlab.yml 文件
vim gitlab.yml
注意:若在docker中給gitlab配置了端口,此處也需要添加端口信息
5、重啟gitlab ,使之生效
gitlab-ctl restart
6、查看結果