标签:程序 res ssh com service host run firewalld 编译
很多企业自建gitlab仓库,用于源代码管理,然后结合jenkins工具实现代码的自动编译打包,项目部署,即实现自动化流水。gitlab下载地址:https://packages.gitlab.com/gitlab/gitlab-ce/
安装环境初始化
yum install curl policycoreutils openssh-server openssh-clients postfix -y
默认,使用 Postfix 发送邮件
service postfix start
chkconfig postfix on
systemctl stop firewalld
systemctl disable firewalld
安装gitlab-ce
配置并启动GitLab
gitlab-ctl reconfigure #重新配置应用程序。相当于初始化一下
gitlab-ctl status
gitlab默认端口为8090,如果端口被占用,可以修改端口号
vim /etc/gitlab/gitlab.rb
external_url ‘http://ip:8899‘
unicorn[‘port‘] = 8899
sed -i ‘13s#http://gitlab.example.com#http://192.168.217.30:8899#‘ /etc/gitlab/gitlab.rb
改:13 external_url ‘http://gitlab.example.com‘
为:13 external_url ‘http://192.168.217.30:8899‘
添加unicorn[‘port‘] =8899 ,防止端口冲突
关闭gitlab: # gitlab-ctl stop
启动gitlab: # gitlab-ctl start
重启gitlab: # gitlab-ctl restart
安装docker:
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl start docker
systemctl enable docker
docker pull gitlab/gitlab-ce
mkdir -p /data/docker/gitlab/{config,data,logs}
启动容器
docker run -itd --name gitlab --hostname gitlab \
--restart always -p 4443:443 -p 8888:80 -p 2222:22 \
-v /data/docker/gitlab/config:/etc/gitlab \
-v /data/docker/gitlab/data:/var/opt/gitlab \
-v /data/docker/gitlab/logs:/var/log/gitlab \
gitlab/gitlab-ce:latest
访问 本机IP地址:8888
标签:程序 res ssh com service host run firewalld 编译
原文地址:https://blog.51cto.com/tuwei/2417590