Gitlab是一个用于仓库管理系统开源项目,使用Git作为代码管理工具,并在此基础上搭建的web服务,可通过web界面进行访问公开或者私人项目,拥有类似于GIthub类似的功能,能够浏览源代码,可管理团队对仓库的访问
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y yum-utils device-mapper-persistent-data lvm2
yum clean all
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "13.224.2.103 download.docker.com" >>/etc/hosts
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl start docker
systemctl enable docker
[root@localhost ~]# cat >/etc/docker/daemon.json<<EOF > { > "registry-mirrors":["https://fxde.mirror.aliyuncs.com"] > } > EOF [root@localhost ~]# cat /etc/docker/daemon.json { "registry-mirrors":["https://fxde.mirror.aliyuncs.com"] }
[root@localhost ~]# mkdir -p /home/gitlab/{config,logs,data}
[root@localhost ~]# docker run -itd --hostname 192.168.175.100 -p 7001:443 -p 7002:80 -p 7003:22 --name gitlab --restart=always -v /home/gitlab/config/:/etc/gitlab -v /home/gitlab/logs/:/var/log/gitlab -v /home/gitlab/data/:/var/opt/gitlab 8e28c88b6a21
64010f0f82d8f2dda8356920975fcb7dfda24f012fa693b3728137fb5b37ec1b
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64010f0f82d8 8e28c88b6a21 "/assets/wrapper" 8 seconds ago Up 3 seconds (health: starting) 0.0.0.0:7003->22/tcp, 0.0.0.0:7002->80/tcp, 0.0.0.0:7001->443/tcp gitlab
[root@localhost ~]# docker exec -it gitlab bash
root@192:/# gitlab-ctl reconfigure
过程省略
。。。。。。。 。。。。。。。 。。。。。。。 Recipe: <Dynamically Defined Resource> * service[unicorn] action restart - restart service service[unicorn] * service[sidekiq] action restart - restart service service[sidekiq] Recipe: gitlab::gitlab-rails * execute[clear the gitlab-rails cache] action run - execute /opt/gitlab/bin/gitlab-rake cache:clear Running handlers: Running handlers complete Chef Client finished, 8/601 resources updated in 06 minutes 18 seconds gitlab Reconfigured!
root@192:/# gitlab-ctl restart
ok: run: alertmanager: (pid 7377) 0s ok: run: gitaly: (pid 7387) 1s ok: run: gitlab-monitor: (pid 7409) 0s ok: run: gitlab-workhorse: (pid 7412) 0s ok: run: logrotate: (pid 7421) 0s ok: run: nginx: (pid 7428) 0s ok: run: postgres-exporter: (pid 7431) 1s ok: run: postgresql: (pid 7444) 0s ok: run: prometheus: (pid 7448) 0s ok: run: redis: (pid 7450) 0s ok: run: redis-exporter: (pid 7462) 0s ok: run: sidekiq: (pid 7510) 1s ok: run: sshd: (pid 7518) 0s ok: run: unicorn: (pid 7553) 1s
root@192:/# gitlab-ctl status
run: alertmanager: (pid 7377) 129s; run: log: (pid 1595) 2354s run: gitaly: (pid 7387) 128s; run: log: (pid 875) 2520s run: gitlab-monitor: (pid 7409) 125s; run: log: (pid 1486) 2376s run: gitlab-workhorse: (pid 7412) 124s; run: log: (pid 1393) 2400s run: logrotate: (pid 7421) 124s; run: log: (pid 1450) 2387s run: nginx: (pid 7428) 123s; run: log: (pid 1419) 2395s run: postgres-exporter: (pid 7431) 123s; run: log: (pid 1630) 2348s run: postgresql: (pid 7444) 121s; run: log: (pid 1080) 2505s run: prometheus: (pid 7448) 121s; run: log: (pid 1555) 2363s run: redis: (pid 7450) 120s; run: log: (pid 833) 2527s run: redis-exporter: (pid 7462) 120s; run: log: (pid 1531) 2372s run: sidekiq: (pid 7510) 106s; run: log: (pid 1356) 2407s run: sshd: (pid 7518) 104s; run: log: (pid 30) 2550s run: unicorn: (pid 7553) 99s; run: log: (pid 1315) 2415s
浏览器访问: http://192.168.175.100:7002/