简体   繁体   English

Gitlab备份机密

[英]Gitlab backup secrets

I have docker ce v9.3.5 running inside a docker container. 我在Docker容器中运行docker ce v9.3.5。

I want to backup gitlab secrets as descrited here 我想备份此处描述的 gitlab机密

I used this command to perform the backup of the secrets and configuration, but it gave me an error: 我使用此命令执行机密和配置的备份,但它给了我一个错误:

docker exec -t <your container name> /bin/sh -c 'umask 0077; tar cfz /secret/gitlab/backups/$(date "+etc-gitlab-\%s.tgz") -C / etc/gitlab'

在此处输入图片说明

I am not sure if the documentation is updated or my docker version is outdated, but looks like there is no "/secret/gitlab/backups" folder inside the container. 我不确定文档是否已更新或我的docker版本是否已过时,但是容器内似乎没有“ / secret / gitlab / backups”文件夹。

My question is: 我的问题是:

1) which command do I need to run exactly? 1)我需要准确运行哪个命令?

1) can i just copy the container folder "/etc/gitlab" , which includes gitlab-secrets.json? 1)我可以只复制包含gitlab-secrets.json的容器文件夹“ / etc / gitlab”吗?

ps: I do have volumes mounted at "/etc/gitlab" , "/var/log/gitlab" and "/var/opt/gitlab" ps:我确实在“ / etc / gitlab”,“ / var / log / gitlab”和“ / var / opt / gitlab”挂载了卷

Please make sure that gitlab_rails['backup_path'] option is indeed /secret/gitlab/backups/ and the path exists. 请确保gitlab_rails ['backup_path']选项确实为/ secret / gitlab / backups /并且路径存在。 The idea is that if you set an different folder for backups then you will have to adjust the command as you have it set in gitlab configuration 这个想法是,如果您为备份设置了其他文件夹,则必须像在gitlab配置中设置的那样调整命令

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

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