docker 中的gitlab 的root 账户密码重置


curl http://gitlabip:端口/api/v4/users?username=root

可以查看指定的账户信息的id ,下面重置用到。

进入容器内:

sudo docker exec -it 容器id /bin/bash
root@757217f938b5:/# gitlab-rails console -e production
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
 GitLab:       13.10.3 (b1774ad36a9) FOSS
 GitLab Shell: 13.17.0
 PostgreSQL:   12.6
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.4)
irb(main):001:0> u=User.where(id:1).first
=> #
irb(main):002:0> u.password = '123456'
=> "123456"
irb(main):003:0> u.password_confirmation='123456'
=> "123456"
irb(main):004:0> u.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: f9526876-0893-4dab-b50f-649883b43d53) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#>]}
=> true
irb(main):005:0> exit

你可能感兴趣的:(docker,gitlab)