Linux环境:centos7.6
一、安装git1. 安装git
yum install -y git
2. 查看git版本
git version
-- 3. 设置git的账户信息
git config --global user.name "pss"
git config --global user.email "[email protected]"
-- 4. 创建ssh密钥,密钥默认保存在当前位置下 的 .ssh文件里 生成一个私钥 id_rsa和一个公钥id_rsa.pub
ssh-keygen -t rsa -C "[email protected]"
一直点回车,生成的公钥密钥位置
/root/.ssh/id_rsa.pub //公钥
/root/.ssh/id_rsa //私钥
二、部署gitlab
1. 创建目录
mkdir -p /docker/gitlab/{logs,conf,data}
2. 安装gitlab/gitlab-ce
docker pull gitlab/gitlab-ce:latest
3. 启动镜像
docker run -d --name gitlab -p 5050:80 -p 1443:443 -p 5051:22 -v /docker/gitlab/conf:/etc/gitlab -v /docker/gitlab/logs:/var/log/gitlab -v /docker/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
如果出现IPv4 forwarding is disabled,重启下网络及docker即可:
systemctl restart network && systemctl restart docker
docker start gitlab
4. 访问ip:port,查询密码
docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
登录root/密码
5. 修改gitlab.rb配置文件,/docker/gitlab/conf/gitlab.rb
external_url 'http://ip:5050'
nginx['listen_port'] = 80
gitlab_rails['gitlab_ssh_host'] = 'ip'
gitlab_rails['gitlab_shell_ssh_port'] = 5051
6. 重启gitlab容器
docker restart gitlab
标签:git,部署,gitlab,rsa,--,ssh,Docker,docker From: https://www.cnblogs.com/df-blog/p/17201866.html