1.镜像容易
[root@iZbp1450an4n9x7ulk8lalZ ~]# docker exec -it gitlab容器ID bash
2.修改密码命令
root@2ee369425153:/# gitlab-rails console -e production
--------------------------------------------------------------------------------
Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 13.10.0 (5eafdaf7b07) FOSS
GitLab Shell: 13.17.0
PostgreSQL: 12.5
--------------------------------------------------------------------------------
Loading production environment (Rails 6.0.3.4)
# 1
irb(main):001:0> user = User.where(id: 1).first
=> #<User id:1 @root>
# 2
irb(main):002:0> user.password = '12345678'
=> "12345678"
# 3
irb(main):003:0> user.password_confirmation = '12345678'
=> "12345678"
# 4
irb(main):004:0> user.save!
Enqueued ActionMailer::MailDeliveryJob (Job ID: 8fa3181d-0aeb-4105-b969-db6c5ff84614) to Sidekiq(mailers) with arguments: "DeviseMailer", "password_change", "deliver_now", {:args=>[#<GlobalID:0x00007f233e0a05d8 @uri=#<URI::GID gid://gitlab/User/1>>]}
=> true
# 5
irb(main):005:0> exit