docker安装使用gitlab

1、安装docker

可参考:https://www.jianshu.com/p/270020e5b313

2、自定义 docker 的默认运行目录和镜像仓库地址(可跳过)

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、注意点

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 "[email protected]" -b 4096

将id_rsa.pub的内容复制到
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

猜你喜欢

转载自blog.csdn.net/u014769528/article/details/83787981