美文网首页
Docker_6_gitlab搬家到gogs并穿透

Docker_6_gitlab搬家到gogs并穿透

作者: zestloveheart | 来源:发表于2019-05-31 10:13 被阅读0次

Motivation

由于原有的gitlab占用内存太大,所以找了一个轻量的工具gogs代替。需要搭建一个gogs,并把原来gitlab上面的内容都转移到gogs上来。

git仓库搬家

# 从原地址克隆一份裸版本库
git clone --bare git://xxxxx.com/xxx.git
# 然后到新的 Git 服务器上创建一个新项目
# 以镜像推送的方式上传代码到 新的 服务器上
cd test.git
git push --mirror git@xxxxx.com/xxx.git
# 删除本地代码
cd ..
rm -rf test.git
# 到新服务器上找到 Clone 地址,直接 Clone 到本地
git clone git@xxxxx.com/xxx.git

docker搭建gogs git服务器并穿透

docker gogs 参考

docker pull gogs/gogs
mkdir /root/zlh/gogs
docker run --name=gogs -p 10022:22 -p 10080:3000 --restart=always --privileged=true -v /root/zlh/gogs:/data gogs/gogs

客户端配置穿透(可选)

[gogs-ssh]
type = tcp
local_ip = localhost
local_port = 10022
remote_port = 10022

[gogs-http]
type = http
local_port = 10080
subdomain = git

配置

外网即可从git.hostname:port登陆gogs,进行初始化设置,设置完后可正常使用。

数据库选sqlite,存放位置:/data/xxxx.sql
应用名称:gooooooooogssssss
# 可以不改 域名:
    有穿透:git.hostname
    无穿透:192.168.1.x
ssh端口号:10022
# http端口号:
    有穿透:则是frps穿透的端口port
    无穿透:则是10080
应用url:
    有穿透:http://git.hostname:port
    无穿透:192.168.1.x:10080

其他

docker Jenkins + gogs 持续集成环境搭建

https://www.cnblogs.com/Erick-L/p/8818697.html
https://www.cnblogs.com/xiaoqi/p/docker-jenkins-cicd.html
https://hub.docker.com/_/jenkins/
https://github.com/jenkinsci/jenkins

参考

https://blog.csdn.net/wangchao8110/article/details/85220918
https://www.jianshu.com/p/2a7acb07b352

docker gitlab 参考

# 把本机的先关了
gitlab-ctl start/stop

# gitlab-ce为稳定版本,后面不填写版本则默认pull最新latest版本
docker pull gitlab/gitlab-ce

相关文章

网友评论

      本文标题:Docker_6_gitlab搬家到gogs并穿透

      本文链接:https://www.haomeiwen.com/subject/lazitctx.html