docker 安装的 gitlab 修改配置/重置密码等

简单记录一下

rails console 进入方法

1
2
3
4
docker exec -it GITLAB_CONTAINER_ID /bin/bash
su - git
cd gitlab
bundle exec rails c production


1
2
docker-compose exec --user git gitlab bundle exec rails c production
# docker exec --user git -it GITLAB_CONTAINER_ID bundle exec rails c production

重置密码

先进入rails console,然后

on rails
1
2
3
4
5
user = User.where(id: 1).first
user.password = 'NEW_PASS'
user.password_confirmation = 'NEW_PASS'
user.save
exit

其他配置(如备份等)

1
2
docker-compose exec --user git gitlab bundle exec rake RAKE_TASK
# eg: docker-compose exec --user git gitlab bundle exec rake gitlab:backup:create RAILS_ENV=production

参考

docker-gitLab

觉得有用的话赞助一点吧~