I found a way to make it work. First connect to your Gitlab with command line and search for your Docker CONTAINER_ID
docker ps -all
eg.

docker exec -it d0bbe0e1e3db bash <-- with your given CONTAINER_ID
$ gitlab-rails console -e production

user = User.where(id: 1).first
user.password = 'your secret'
user.password_confirmation = 'your secret'
user.save
exit
Answer from hannes ach on Stack OverflowDefault username/password not working.
Can't sign in on new install
Cannot log into new GitLab installation
gitlab initial root password - Stack Overflow
I found a way to make it work. First connect to your Gitlab with command line and search for your Docker CONTAINER_ID
docker ps -all
eg.

docker exec -it d0bbe0e1e3db bash <-- with your given CONTAINER_ID
$ gitlab-rails console -e production

user = User.where(id: 1).first
user.password = 'your secret'
user.password_confirmation = 'your secret'
user.save
exit
The new-ish hotness to change Gitlab's "root" account's password is this:
gitlab-rake "gitlab:password:reset[root]"
And if you're running Gitlab inside a Docker container, then use this from the host (you may have to "sudo" this depending on your situation):
docker exec -it gitlab gitlab-rake "gitlab:password:reset[root]"
This assumes that you named your Gitlab container "gitlab". And be patient; don't be surprised if it takes more than a few seconds before the "Enter password:" prompt shows up.
Greetings,
I recently set up a docker stack on my synology NAS to host gitlab. It spins up and I can get to the login screen, but I cannot login. I tried the default credentials of admin@local.host and 5iveL!fe , to no avail. Any ideas? Is there some other password now? Or some way I can set an initial default with an environment variable or something?
I had a similar problem. Even if I set the environment variable, it seems that my gitlab ce still can't login. So I reset the password with the "root" user.
# dir: /etc/gitlab
gitlab-rake "gitlab:password:reset[root]"
Wait 10 minutes. And result
Enter password:
Confirm password:
Password successfully updated for user with username root.
Then all works as usual.
If you are using Docker, you can get this bash:
docker exec -it gitlab_continer bash
and open Rails console.
gitlab-rails console -e production
and Enter the code below
user = User.where(id: 1).first
user.password = 'your secret'
user.password_confirmation = 'your secret'
user.save
exit
You can get more information from the link below https://docs.gitlab.com/ee/security/reset_user_password.html
The solution is to set the GITLAB_OMNIBUS_CONFIG as an environment variable.
This works:
services:
// other services..
gitlab:
image: 'gitlab/gitlab-ce'
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['initial_root_password'] = 'adminadmin'
ports:
- '80:80'
- '443:443'
- '22:22'
- "127.0.0.1:8081:80"
volumes:
- '/etc/gitlab'
- '/var/log/gitlab'
- '/var/opt/gitlab'
networks:
- backend
When starting up the service, this is confirmed:
gitlab_1 | == Seed from /opt/gitlab/embedded/service/gitlab-rails/db/fixtures/production/002_admin.rb
gitlab_1 | Administrator account created:
gitlab_1 |
gitlab_1 | login: root
gitlab_1 | password: adminadmin
This is how I fixed this issue on my side:
sudo docker exec -it container_name bash
// replace username by your user, for me it is root
gitlab-rake "gitlab:password:reset[username]"