我在RaspberryPi上做了几年的Gitlab。现在,我想将存储库移到基于码头的Gitlab中。所有设置都是最好的。
我已经阅读了使用说明,并尝试了以下有关数据的内容:
所以我的问题是:
实验
docker run \
--detach \
--rm \
--name gitlab \
--network host \
--volume ${PWD}/etc/gitlab:/etc/gitlab \
--volume ${PWD}/var/opt/gitlab:/var/opt/gitlab \
gitlab/gitlab-ce:latest如果我用这个命令创建一个容器,使用GITLAB做一些事情,而不是删除容器并启动一个新的容器:这是可行的。在这种情况下,GITLAB的版本是相同的fpr,两个容器。
发布于 2019-12-19 15:15:57
遵循c4f4t0r的提示,我解决了这个问题如下:
gitlab/glitlab-ce:9.2.7-ce.0并在其中还原了备份。/mnt/gitlab_ws/├──备份/ <--包含gitlab.rb;gitlab-sections.json和ssh stuf├──git-data/ <-最初为空└──var/opt/gitlab/ <--最初为空
1. I have chosen the following folder structure within the docker container:/├──etc/gitlab/├──mnt/gitlab_ws/backup/<-将设置在*/etc/gitlab/gitlab.rb*├──mnt/gitlab_ws/git-data/ <-中设置为*/etc/gitlab/gitlab.rb*└──var/├──/gitlab/
1. running gitlab./run_gitlab.sh 9.2.7
1. Ensure the correct write permissions. If you set the permissions on host side, the permissions within the container might be not the same. You may want to set the correct access rights after starting the container:docker exec -it gitlab chown -R git:git /var/opt/gitlab / etc/gitlab /mnt/gitlab_ws/git--R/mnt/gitlab/-R备份
1. Restore the backup./restore_backup.sh .
1. Check if the Gitlab is now running correctly, showing all repositories and users (If not, the problem might be related to the access rights of _/etc/gitlab_) and the repositories have the expected content (If not, the problem might be related to the _git-data_ path setting in _/etc/gitlab/gitlab.rb_ or the access rights.)../run_gitlab.sh 9.3.0启动更高的gitlab之后(容器状态变为“健康”--这可能需要一些时间),您现在应该重新配置gitlab:
./reconfigure_gitlab.sh从现在起,您可以重复最后的步骤,直到您达到您想要的版本。您也可以自动化这一点;)
run_gitlab.sh
#/bin/bash
GITLAB_WS_PATH='/mnt/gitlab_ws'
if [ $# -eq 0 ]
then
TAG='latest'
else
TAG=$1-ce.0
fi
docker run \
--name gitlab \
--detach \
--restart always \
--network host \
--volume $GITLAB_WS_PATH/git-data/:/mnt/gitlab_ws/git-data \
--volume $GITLAB_WS_PATH/var/opt/gitlab:/var/opt/gitlab \
--volume $GITLAB_WS_PATH/etc/gitlab:/etc/gitlab \
--volume $GITLAB_WS_PATH/backups:/mnt/gitlab_ws/backups \
gitlab/gitlab-ce:${TAG}restore_backup.sh
#!/bin/bash
DE="docker exec -it gitlab"
${DE} gitlab-ctl stop unicorn
${DE} gitlab-ctl stop sidekiq
${DE} gitlab-rake gitlab:backup:restore
${DE} gitlab-ctl reconfigure
${DE} gitlab-ctl restartreconfigure_gitlab.sh
#!/bin/bash
DE="docker exec -it gitlab"
${DE} gitlab-ctl stop
${DE} gitlab-ctl reconfigure
${DE} gitlab-ctl starthttps://serverfault.com/questions/995506
复制相似问题