首先进入到容器控制台

1、docker ps | grep ‘容器名’

2、docker exec -it ‘容器ID’ bash

执行

3、cat /etc/gitlab/initial_root_password

返回结果是密码

密码文件会在首次执行reconfigure24小时被删除

如果上面的初始化密码文件已经不存在,或者忘记密码那么使用下面这个方法

1、gitlab-rails console

返回:gitlab版本信息

2、u=User.where(id:1).first

返回:=> #<User id:1 @root>

3、User.all

返回:=> #<ActiveRecord::Relation [#<User id:1 @root>]>

4、u.password='12345678'

返回:=> "12345678"

5、u.password_confirmation='12345678'

返回:=> "12345678"

6、u.save!

返回:=> true

7、exit

完毕,使用新密码登录即可

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐