0.选择一台高配服务器(四核8G/两核4G)
1.docker安装和启动
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum install docker-ce -y
systemctl start docker
systemctl enable docker
systemctl status docker
2.配置docker镜像加速器
针对Docker客户端版本大于 1.10.0 的用户
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://780urbjd.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
3.获取镜像
docker pull beginor/gitlab-ce:11.0.1-ce.0
4.运行镜像
mkdir -p /home/software/gitlab/etc
mkdir -p /home/software/gitlab/logs
mkdir -p /home/software/gitlab/data
docker run \
--detach \
--publish 8443:443 \
--publish 8090:80 \
--publish 8022:22 \
--name gitlab \
--restart always \
--hostname 140.143.36.35 \
-v /home/software/gitlab/etc:/etc/gitlab \
-v /home/software/gitlab/logs:/var/log/gitlab \
-v /home/software/gitlab/data:/var/opt/gitlab \
-v /etc/localtime:/etc/localtime:ro \
--privileged=true beginor/gitlab-ce
hostname 必须填写服务器公网ip或者局域网ip
5.访问gitlab(公网ip+8090端口)页面.重置密码