1、新建gitlab目录,并配置环境变量GITLAB_HOME为gitlab目录地址

2、在gitlab目录下,准备docker-compose.yml文件,内容如下:

version: '3.6'
services:
  web:
    image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest'
    container_name: 'gitlab'
    restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://gitlab.example.com:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '2224:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'

执行命令运行:docker compose up -d  (gitlab.example.com可以换成自己的域名)

3、修改配置文件gitlab.rb(在GITLAB_HOME对应地址下的config目录中)

      使用docker logs -f gitlab 命令监控步骤2是否完成,完成后修改配置如下:

       external_url ’http://gitlab.example.com:8929‘   // gitlab.example.com可以换成自己的域名
       gitlab_rails['gitlab_shell_ssh_port'] = 2224 

       ps: 服务器记得开放8929和2224端口

4、重启配置

     执行  docker exec -it gitlab /bin/bash 命令进入容器

     执行 gitlab-ctl reconfigure 命令重启配置

5、查询 root用户名 的密码

    docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password

6、访问 http://gitlab.example.com:8929  使用root和步骤5查询的密码登录系统

ps: 官网安装地址 https://docs.gitlab.cn/jh/install/docker.html

posted @ 2023-07-04 16:53 我没有领悟 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1、sudo docker volume create portainer_data 2、sudo docker run -d -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker 阅读全文
posted @ 2023-06-29 14:11 我没有领悟 阅读(163) 评论(0) 推荐(0) 编辑
摘要: go 多平台编译打包 阅读全文
posted @ 2020-10-30 10:17 我没有领悟 阅读(1609) 评论(0) 推荐(0) 编辑
摘要: 正则表达式 阅读全文
posted @ 2020-10-27 09:51 我没有领悟 阅读(192) 评论(0) 推荐(0) 编辑
摘要: docker常用命令 阅读全文
posted @ 2020-05-29 18:07 我没有领悟 阅读(248) 评论(0) 推荐(0) 编辑
摘要: docker安装gitlab 阅读全文
posted @ 2020-05-29 11:55 我没有领悟 阅读(671) 评论(0) 推荐(0) 编辑
摘要: docker安装nginx 阅读全文
posted @ 2020-05-29 11:42 我没有领悟 阅读(1834) 评论(0) 推荐(1) 编辑
摘要: go语言依赖注入实现 阅读全文
posted @ 2020-05-25 11:06 我没有领悟 阅读(3239) 评论(0) 推荐(0) 编辑
摘要: go反射 阅读全文
posted @ 2020-05-19 21:05 我没有领悟 阅读(915) 评论(0) 推荐(0) 编辑
摘要: go反射实现实体映射 阅读全文
posted @ 2020-05-06 17:43 我没有领悟 阅读(610) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示