天天看點

centos7下docker搭建gitlab-ce中文版

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           
centos7下docker搭建gitlab-ce中文版

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

centos7下docker搭建gitlab-ce中文版

5.通路gitlab(公網ip+8090端口)頁面.重置密碼

centos7下docker搭建gitlab-ce中文版

繼續閱讀