美文网首页
docker-compose 安装Gitlab

docker-compose 安装Gitlab

作者: heichong | 来源:发表于2022-12-27 17:13 被阅读0次

    创建一个文件夹:/home/docker/gitlab
    docker-compose.yml

    version: '3.6'
    services:
      web:
        image: 'gitlab/gitlab-ce:15.3.3-ce.0'
        restart: always
        hostname: 'gitlab.****.com.cn'
        environment:
          GITLAB_OMNIBUS_CONFIG: |
            external_url 'http://gitlab.****.com.cn'
            gitlab_rails['gitlab_shell_ssh_port'] = 9922
        ports:
          - '80:80'
          - '443:443'
          - '9922:22'
        volumes:
          - '/home/docker/gitlab/config:/etc/gitlab'
          - '/home/docker/gitlab/logs:/var/log/gitlab'
          - '/home/docker/gitlab/data:/var/opt/gitlab'
        shm_size: '256m'
    

    hostname: 'gitlab.****.com.cn'为gitlab的ip或域名
    external_url 'http://gitlab.****.com.cn'为gitlab开放的ip或域名(要包含端口)

    执行命令:

    docker-compose up -d
    

    等待镜像下载。。。。

    获取初始用户root的密码

    docker exec -it $(docker ps | grep gitlab | awk '{print $1}') grep 'Password:' /etc/gitlab/initial_root_password
    

    访问地址:
    http://10.3.23.193:9980

    通过root账号登录成功

    version: '3.6'
    services:
      web:
        image: 'gitlab/gitlab-ce:15.3.3-ce.0'
        restart: always
        hostname: 'gitlab.bidr.com.cn'
        environment:
          GITLAB_OMNIBUS_CONFIG: |
            external_url 'https://gitlab.bidr.com.cn'
            gitlab_rails['gitlab_shell_ssh_port'] = 9922
        ports:
          - '80:80'
          - '443:443'
          - '9922:22'
        volumes:
          - '/home/docker/gitlab/config:/etc/gitlab'
          - '/home/docker/gitlab/logs:/var/log/gitlab'
          - '/home/docker/gitlab/data:/var/opt/gitlab'
        shm_size: '256m'
    

    相关文章

      网友评论

          本文标题:docker-compose 安装Gitlab

          本文链接:https://www.haomeiwen.com/subject/frfportx.html