1. 程式人生 > 實用技巧 >系統學習Docker 踐行DevOps理念-第12章 Docker+DevOps實戰——過程和工具

系統學習Docker 踐行DevOps理念-第12章 Docker+DevOps實戰——過程和工具

1.本章簡介

2.搭建GitLab伺服器

參考:https://about.gitlab.com/install/

1.準備工作

以Centos為例,準備一臺至少記憶體為4G的機器

2.安裝依賴軟體

sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld

如果使用郵件服務安裝下面依賴

sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix

安裝其他工具

sudo yum install -y git vim gcc glibc-static telnet

2.設定GitLab安裝源

修改配置

vim /etc/yum.repos.d/gitlab-ce.repo

使用清華大學源

[gitlab-ce]
name=gitlab-ce
baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
repo_gpgcheck=0
gpgcheck=0
enabled=1

如果是國外的話可以使用

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

3.安裝GitLab

sudo  yum install -y gitlab-ce

安裝完成後執行下面命令進行配置

sudo gitlab-ctl reconfigure