之前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
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐