docker run --name gitlab --restart=always \
-d --link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
--hostname 192.168.200.12 -p 10022:22 -p 8899:80 \
-e ‘GITLAB_PORT=8899‘ -e ‘GITLAB_SSH_PORT=10022‘ \
-e ‘GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string‘ \
-e ‘GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string‘ \
-e ‘GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string‘ \
-e ‘GITLAB_HOST=192.168.200.12‘ \
-e ‘SMTP_AUTHENTICATION=login‘ -v /docker_data/gitlab/data:/home/git/data gitlab/gitlab-ce
docker exec -it gitlab bash
gitlab-rails console -e production // 耐心等待 需要几分钟 user = User.where(
id
: 1).first //查找root 用户
user.password = ‘lwc12345..‘ #修改密码
user.password_confirmation = ‘lwc12345..‘ #修改密码
user.save! #保存
exit // 最后依次输入退出容器