Docker上的GitLab:如何在部署之间持久保存用户数据? [英] GitLab on Docker: how to persist user data between deployments?

查看:516
本文介绍了Docker上的GitLab:如何在部署之间持久保存用户数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用官方的GitLab Docker映像.

I am using the official GitLab Docker image.

我想在我的GitLab容器中提供预配置的用户帐户以用于测试.

I want to have pre-configured user accounts available in my GitLab container to be used for tests.

但是用户帐户保存在一个卷中,因此创建测试用户后,我不能只是commitpush GitLab映像.

But user accounts are saved in a volume, so I can't just commit and push the GitLab image after having created my test users.

所以:我应该如何保留它们?

So: how should I persist them?

一种方法是在每次新部署后使用API​​在启动时创建它们,但这非常缓慢/繁琐.

One way would be to create them on startup using the API after each new deployment, but this is quite slow/cumbersome.

推荐答案

正如您所说,由于在gitlab-ce和gitlab-ee映像中声明了VOLUME,所以它不会像提交和推送Docker映像那样容易

As you said, it's not going to be as easy as committing and pushing a Docker image because of the VOLUMEs declared in the gitlab-ce and gitlab-ee images.

也许您可以备份并还原实例?因此,创建所需状态的备份(包括预配置的帐户),然后在启动后将其还原到新的GitLab容器上吗?

Perhaps you can backup and restore the instances? So, create a backup of the state you want including the pre-configured accounts, and then restore that onto new GitLab containers after they're started?

这篇关于Docker上的GitLab:如何在部署之间持久保存用户数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆