Docker builds gitlab

System ubuntu 16.04l
1. Install docker
2. Install docker-compose
3. Create a new directory /home/user/docker-compose/gitlab
4. Create docker-compose.yml in the newly created directory

web:
  image: 'gitlab/gitlab-ce:latest'
  restart: always
  hostname: '192.168.0.105'
  environment:
    GITLAB_OMNIBUS_CONFIG: |
      external_url 'http://192.168.0.105:9090'
      gitlab_rails['gitlab_shell_ssh_port'] = 8022
  ports:
    - '9090:9090'
    - '8022:22'
  volumes:
    - '/srv/gitlab/config:/etc/gitlab'
    - '/srv/gitlab/logs:/var/log/gitlab'
    - '/srv/gitlab/data:/var/opt/gitlab'

5. Execute
docker-compose up -d

6. Visit the page and
enter : http://ip:9090, you can see that the gitlab private server has been started



7. Backup and recovery of git in docker environment
7.1 git backup
      docker exec -it containerId sh
      gitlab-rake gitlab:backup:create, After using the command, a backup file containing the date will be generated in the /var/opt/gitlab/backups directory.
7.2 git recovery
      docker exec -it containerId sh
       7.2.1 Stop related data connection services
                gitlab-ctl stop unicorn
                gitlab-ctl stop sidekiq
       7.2 .2 gitlab-rake bitlab:backup:restore BACKUP=**** (only the date when the file was generated during backup)

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326885066&siteId=291194637