GitLab与CentOS的集成方式主要有以下两种:
curl
、policycoreutils-python
、openssh-server
等依赖包,启动SSH服务并开放HTTP/HTTPS端口。curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
添加GitLab的Yum源。sudo yum install gitlab-ce
进行安装。/etc/gitlab/gitlab.rb
文件,设置外部URL、SMTP邮件服务器等参数,然后执行sudo gitlab-ctl reconfigure
使配置生效。sudo gitlab-ctl start
启动GitLab服务。docker pull gitlab/gitlab-ce:latest
命令拉取GitLab的Docker镜像。docker run
命令运行容器,指定端口映射、数据卷等参数,例如docker run --detach --hostname gitlab.example.com --publish 8080:80 --publish 443:443 --publish 2222:22 --name gitlab --privileged --restart always --volume /home/docker/gitlab/config:/etc/gitlab --volume /home/docker/gitlab/logs:/var/log/gitlab --volume /home/docker/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
。