计算机知识分享网

【gitlab】Docker搭建本地gitlab初始化管理员账号和密码

1这个管理员账号的账号名为 root,密码且会在 24 小时后自动被删除。存放在
 /etc/gitlab/initial_root_password

实际上,在第一次使用命令 gitlab-ctl reconfigure 初始化 GitLab 配置时,GitLab 其实已经提示过这些信息,只是很多人对英文不敏感,尤其是一长段英文中夹杂着一个重要信息时。

Infra Phase complete, 545/1516 resources updated in 04 minutes 26 seconds
Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn't opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.
NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.
gitlab Reconfigured!
我们可以进入容器,并得到密码
docker exec -it 3bebf1976b7b /bin/bash

root@gitlab:/# cd /etc/gitlab/

root@gitlab:/etc/gitlab# ls
gitlab-secrets.json  initial_root_password  ssh_host_ecdsa_key.pub  ssh_host_ed25519_key.pub  ssh_host_rsa_key.pub
gitlab.rb            ssh_host_ecdsa_key     ssh_host_ed25519_key    ssh_host_rsa_key          trusted-certs

#编辑查看
vi initial_root_password
root@gitlab:/etc/gitlab# vi initial_root_password 

# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-r

Password: gaG1KAJtDFFx+bZ5q9U0+B/XGanIWyFTu5eCTW+PepPzQTI=

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
gitlab版本可以使用
docker pull gitlab/gitlab-ce:12.3.5-ce.0
docker pull gitlab/gitlab-ce:15.2.2-ce.0

#Gitlab