问题
I am using the official GitLab Docker image.
I want to have pre-configured user accounts available in my GitLab container to be used for tests.
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?
One way would be to create them on startup using the API after each new deployment, but this is quite slow/cumbersome.
回答1:
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.
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?
来源:https://stackoverflow.com/questions/51731648/gitlab-on-docker-how-to-persist-user-data-between-deployments