docker搭建gitlab,重置密码 电玩女神 2022-05-14 06:51 340阅读 0赞 拉取GitLab镜像 \# docker pull gitlab/gitlab-ce 启动gitlab docker run -d --hostname 192.168.1.229:8181 -p 443:443 -p 8181:8081 -p 2222:22 --privileged=true /踩过的坑取得特殊权限 --name gitlab --restart always -v /home/caoqing/gitlab/ins/config:/etc/gitlab -v /home/caoqing/gitlab/ins/logs:/var/log/gitlab -v /home/caoqing/gitlab/ins/data:/var/opt/gitlab -v /etc/localtime:/etc/localtime gitlab/gitlab-ce:latest 查看日志:gitlab是容器名 1000行 docker logs -f -t --tail 1000 gitlab ![70][] 晕乎的是启动后给了一个密码,然后忘了^\_^ 重置docker下gitlab的密码: 进入容器命令:docker exec -it <容器id> bash 实例如下图。 1. 执行gitlab-rails console 2. user = User.where(username: ‘root’).first 3. user.password = ‘password’ 4. user.save! 有图有真相 ![70 1][] ![70 2][] 退出容器:ctrl+d 参考文章:[https://blog.csdn.net/dongdong9223/article/details/52998375][https_blog.csdn.net_dongdong9223_article_details_52998375] [https://www.jianshu.com/p/a1ab1d26e337][https_www.jianshu.com_p_a1ab1d26e337] [70]: /images/20220514/7701168fb68a4a93a32e0b5dc3bbae65.png [70 1]: /images/20220514/f0845d33a2714fc19a12f289a01cdf5d.png [70 2]: /images/20220514/6aef08bb0ea24d9596ff29843cd5853e.png [https_blog.csdn.net_dongdong9223_article_details_52998375]: https://blog.csdn.net/dongdong9223/article/details/52998375 [https_www.jianshu.com_p_a1ab1d26e337]: https://www.jianshu.com/p/a1ab1d26e337
还没有评论,来说两句吧...