gitlab迁移到docker

备份gitlab数据

gitlab-rake gitlab:backup:create
在docker上拉取对应版本的镜像
docker pull gitlab/gitlab-ce:14.2.3-ce.0
编写docker-compose文件
version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ce:14.2.3-ce.0'
    restart: always
    container_name: 'gitlab'
    hostname: 'gitlab'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://192.168.10.10:8888'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '0.0.0.0:8888:8888'
      - '0.0.0.0:2224:22'
    volumes:
      - '/data/gitlab/config:/etc/gitlab'
      - '/data/gitlab/logs:/var/log/gitlab'
      - '/data/gitlab/data:/var/opt/gitlab'
    s

你可能感兴趣的:(git)