gitlab部署

参考文档https://gitlab.cn/docs/jh/install/docker.html

配置变量环境

export GITLAB_HOME=/srv/gitlab

docker-compose up部署,启动需要一定时间

version: '3.6'
services:
  web:
    image: 'registry.gitlab.cn/omnibus/gitlab-jh:latest'
    restart: always
    hostname: 'gitlab.example.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://172.30.64.110'
        # Add any other gitlab.rb configuration here, each on its own line
    ports:
      - '80:80'
      - '443:443'
      - '2222:22'
    volumes:
      - '$GITLAB_HOME/config:/etc/gitlab'
      - '$GITLAB_HOME/logs:/var/log/gitlab'
      - '$GITLAB_HOME/data:/var/opt/gitlab'
    shm_size: '256m'

查看密码

sudo docker exec -it 容器名称 grep 'Password:' /etc/gitlab/initial_root_password