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 "your.email@example.com" -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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值