docker版本的gitlab遷移
阿新 • • 發佈:2019-01-06
之前office有一個gitlab,執行在centos7下面的docker映象,版本8.4.3,為了提高可靠性,需要對其進行備份以及還原操作,所以才有了這篇。
- 準備一臺centos7
- 部署docker repo,安裝docker命令和egine
# base repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# epel repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7. repo
# docker repo
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
- 部署目錄/opt/gitlab,將遠端備份的tar檔案進行解壓釋放
- 部署目錄/root/gitlab/start.sh
sudo docker run --detach \
--hostname gitlab1.ops.ac.cn \
--publish 5443:443 --publish 580:80 --publish 522:22 \
--name gitlab \
--restart always \
--volume /opt/gitlab/config:/etc/gitlab \
--volume /opt/gitlab/logs:/var/log/gitlab \
--volume /opt/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
sudo docker run --detach \
--hostname gitlab1.ops.ac.cn \
--publish 5443:443 --publish 580:80 --publish 522:22 \
--env GITLAB_OMNIBUS_CONFIG ="external_url 'http://gitlab1.ops.ac.cn:580/'; gitlab_rails['lfs_enabled'] = true; gitlab_rails['lfs_storage_path'] = '/var/opt/gitlab-lfs-objects'"
--name gitlab \
--restart always \
--volume /opt/gitlab/config:/etc/gitlab \
--volume /opt/gitlab/logs:/var/log/gitlab \
--volume /opt/gitlab/data:/var/opt/gitlab \
--volume /opt/gitlab/lfs-data:/var/opt/gitlab-lfs-storage \
gitlab/gitlab-ce:latest