• docker-compose docker compose up -d
    version: '3.6'
    services:
      web:
        image: 'gitlab/gitlab-ce:latest'
        restart: always
        hostname: 'localhost'
        environment:
          GITLAB_OMNIBUS_CONFIG: |
            external_url 'http://localhost: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'
          - '/Users/yanlp/workspace/docker/gitlab_latest/config:/etc/gitlab'
          - '/Users/yanlp/workspace/docker/gitlab_latest/logs:/var/log/gitlab'
          - '/Users/yanlp/workspace/docker/gitlab_latest/data:/var/opt/gitlab'
        shm_size: '256m'
    
  • 登陆容器 docker ps -a docker exec -it 2d9f11bc4619 /bin/bash
  • 执行gitlab-rails dbconsole
  • 导出 gitlabhq_production=> \! pg_dump -U gitlab -d gitlabhq_production -s > /tmp/all.sql

docker安装gitlab 并dump出表结构-LMLPHP

11-22 05:27