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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容