共计 1106 个字符,预计需要花费 3 分钟才能阅读完成。
CICD 系列之一:装置 gitlab
筹备主机:10.0.0.14
1. 敞开防火墙和 SELINUX
systemctl stop firewalld
systemctl disable firewalld
sed -i ‘s/enforcing/disabled/’ /etc/selinux/config
setenforce 0
2. 装置 docker
3. 装置 docker-compose
下载适宜你以后 linux 版本的 docker-compose 组件
sudo curl -L “https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
减少执行权限
sudo chmod +x /usr/local/bin/docker-compose
查看 docker-compose 版本
docker-compose –version
4. 搭建 gitlab 公有仓库 (应用内建的 postgresql 和 redis)
mkdir -p /home/disk1/gitlab
mkdir -p /home/disk1/gitlab/{config,data,logs}
cd /home/disk1/gitlab && vi docker-compose.yml
version: ‘3’
services:
gitlab:
container_name: gitlab
image: 'twang2218/gitlab-ce-zh:11.1.4'
restart: unless-stopped
hostname: 'dev-poc'
environment:
TZ: 'Asia/Shanghai'
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://dev-poc:10101'
gitlab_rails['time_zone'] = 'Asia/Shanghai'
gitlab_rails['gitlab_shell_ssh_port'] = 22
ports:
- '10101:10101'
- '443:443'
- '2222:22'
volumes:
- ./config:/etc/gitlab
- ./data:/var/opt/gitlab
- ./logs:/var/log/gitlab
5. 本地域名
echo “10.0.0.14 dev-poc” >> /etc/hosts
6. 启动
docker-compose up -d
docker-compose ps
7. 拜访 http://10.0.0.14:10101 并更改 root 用户明码
正文完