1、安裝docker
可參考:http://www.itdecent.cn/p/270020e5b313
2、自定義 docker 的默認(rèn)運(yùn)行目錄和鏡像倉庫地址(可跳過)
docker鏡像地址選用阿里云

image.png
vim /etc/docker/daemon.json
添加
{
"graph":"/opt/docker",
"registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"]
}
重啟
systemctl restart docker
查看
docker info

image.png
3、下載docker鏡像
docker pull gitlab/gitlab-ce:latest
4、開放阿里云安全組端口、配置防火墻(8443、880、822)
docker run -d \
--publish 8443:443 --publish 880:80 --publish 822:22 \
--name gitlab \
--volume /opt/gitlab/config:/etc/gitlab \
--volume /opt/gitlab/logs:/var/log/gitlab \
--volume /opt/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce
5、登陸gitlab
http://ip:880/users/sign_in(需要等待幾分鐘,待gitlab啟動完成)
6、注意點(diǎn)
http:
將 http://954a3593a13b/hsshy/guns-parent.git 中的954a3593a13b改為你的ip加端口
git clone http://ip:880/hsshy/guns-parent.git
ssh:
到.ssh目錄下生成公鑰私鑰
ssh-keygen -t rsa -C "your.email@example.com" -b 4096
將id_rsa.pub的內(nèi)容復(fù)制到

image.png

image.png

image.png
將 git@954a3593a13b:hsshy/guns-parent.git 中的 954a3593a13b:hsshy 改成 ip:822/hsshy
git clone ssh://git@ip:822/hsshy/guns-parent.git