gitlab安装

centos7先更新containerd

sudo yum install containerd

docker pull gitlab/gitlab-ce:16.3.4-ce.0

docker-compose.yml

bash 复制代码
version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ce:16.3.4-ce.0'
    restart: always
    hostname: 'node2'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.227.128'
        # Add any other gitlab.rb configuration here, each on its own line
    ports:
      - '80:80'
      - '443:443'
      - '2222:22'
    volumes:
      - '/usr/share/local/gitlab/config:/etc/gitlab'
      - '/usr/share/local/gitlab/logs:/var/log/gitlab'
      - '/usr/share/local/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'
c 复制代码
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.227.128  netmask 255.255.255.0  broadcast 192.168.227.255
        inet6 fe80::20c:29ff:fedf:8b  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:df:00:8b  txqueuelen 1000  (Ethernet)
        RX packets 48559  bytes 63651085 (60.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 25226  bytes 2113318 (2.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
c 复制代码
在浏览器中输
入以下地址来访问GitLab界面:

http://192.168.227.128:80 或者 http://localhost:80
https://192.168.227.128:443 或者 https://localhost:443
ssh://192.168.227.128:2222 或者 ssh://localhost:2222

重置root密码:

1.进入容器:

docker exec -it <容器名称或ID> /bin/bash

2.进入GitLab Rails控制台:

gitlab-rails console

3.重置root用户的密码:

bash 复制代码
user = User.where(id: 1).first
user.password = '新密码'
user.password_confirmation = '新密码'
user.save

这个时候密码可能设置错误,因为gitlab的密码策略非常严格,包括至少一个小写字母、一个大写字母、一个数字和一个特殊字符,而且,密码包含常见的单词和字母组合也不行,而且,密码里面最好不要有!符号,可以用@代替

如果上面的步骤失败了,可以尝试这个步骤:

bash 复制代码
gitlab-rake "gitlab:password:reset[root, 'R0@tR00tP@ssw0rd']"

gitlab-ctl restart

4.退出GitLab Rails控制台:

exit

5.退出容器终端:

exit

装好之后长这样:

相关推荐
yunson_Liu1 天前
jenkins更新了gitlab后出现报错
运维·gitlab·jenkins
小杨的全栈之路1 天前
生产级实践:在 Docker 中安全导入自签名证书,保障 Spring Boot 应用通信安全
docker·https
stark张宇1 天前
Git 与 GitHub 协同工作流:从0到1搭建版本控制体系
git·gitlab·github
计算机小手1 天前
推荐一个 GitHub 开源项目信息卡片生成工具,支持Docker快速部署和API调用
经验分享·docker·github·开源软件
饭来_1 天前
通过 SSH 远程连接 docker 容器
vscode·docker·ssh
kura_tsuki1 天前
[Docker集群] Docker 容器入门
运维·docker·容器
开始学AI1 天前
【Docker技术】docker-compose.yml与Dockerfile解析
java·docker·eureka
一水鉴天2 天前
整体设计 逻辑系统程序 之18 Source 容器(Docker)承载 C/P/D 三式的完整设计与双闭环验证 之2
docker·架构·认知科学·公共逻辑
飞快的蜗牛2 天前
利用linux系统自带的cron 定时备份数据库,不需要写代码了
java·docker
香吧香2 天前
Docker Registry 使用总结
docker