简体   繁体   English

Gitlab docker 备份和恢复

[英]Gitlab docker backup and restore

I am using GitLab via docker on an intranet disconnected from the internet.我在与 Internet 断开连接的 Intranet 上通过 docker 使用 GitLab。 I run GitLab docker using docker-compose following yml file.我在 yml 文件之后使用 docker-compose 运行 GitLab docker。

web:
    image: 'gitlab/gitlab-ee:latest'
    restart: always
    hostname: 'myowngit.com'
    ports:
        - 8880:80
        - 8443:443
    volumes:
        - /srv/gitlab/config:/etc/gitlab
        - /srv/gitlab/logs:/var/log/gitlab
        - /srv/gitlab/data:/var/opt/gitlab

Then free space of 'volumes' is not enough so i move this path to '/mnt/mydata'.然后“卷”的可用空间不够,所以我将此路径移动到“/mnt/mydata”。 And I modify docker-compose.yml file.我修改了 docker-compose.yml 文件。

... ... ...
    volumes:
        - /mnt/mydata/gitlab/config:/etc/gitlab
        - /mnt/mydata/gitlab/logs:/var/log/gitlab
        - /mnt/mydata/gitlab/data:/var/opt/gitlab

To start GitLab service run sudo docker-compose up -d .要启动 GitLab 服务运行sudo docker-compose up -d After running the GitLab service I try to explore the project repository but the repository is not found(HTTP response 404 or 503).运行 GitLab 服务后,我尝试探索项目存储库,但未找到存储库(HTTP 响应 404 或 503)。 What is the reason?是什么原因? How to move GitLab docker volume directory?如何移动 GitLab docker 卷目录?

It should work unless, as shown in docker-gitlab issue 562 , to move was done with a different ownership它应该可以工作,除非如docker-gitlab issue 562所示,移动是用不同的所有权完成的

It should be okay to move the files from /data1/data to /data2/data , you should take a little care while copying the files to the new location.将文件从/data1/data移动到/data2/data应该没问题,在将文件复制到新位置时应该小心。 ie either of these should be fine即其中任何一个都应该没问题

cp -a /data1/data /data2/data rsync --progress -av /data1/data /data2/data

Simply doing cp -r /data1/data /data2/data will not preserve the ownership of the files which will cause issues.简单地执行cp -r /data1/data /data2/data不会保留会导致问题的文件的所有权。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM