使用Docker安装的Gitlab在应用过程中的踩坑经历
1. Docker安装Gitlab,因为端口占用问题,将镜像的22端口映射到宿主机的8022端口
2. 无法使用ssh认证的问题
3. 后续在使用ssh协议 push代码时应该使用8022端口
- 进入gitlab的配置文件 gitlab.rb
- 修改配置 gitlab_rails[‘gitlab_ssh_host’] 和 gitlab_rails[‘gitlab_shell_ssh_port’]
4. 解决公司Gitlab和个人GitHub邮箱账号不同,ssh认证问题
- 创建config文件(~/.ssh/)
# The git info for company
Host 172.23.112.16
HostName 172.23.112.16
User went@aoyang.com
IdentityFile ~/.ssh/id_rsa_gitlab
# The git info for github
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github/id_rsa