Docker学习之使用docker-compose.yml方式,gitlab安装和配置

使用docker-compose方式安装

教程地址https://www.bilibili.com/video/av36042649/?p=48

创建文件夹
mkdir -p /usr/local/docker/gitlab
编辑
vi docker-compose.yml
如下代码
version: '3'
services: 
  web:
    image: 'twang2218/gitlab-ce-zh'
    restart: always
    hostname: '192.168.112.134'
    environment:
      TZ: 'Asia/Shanghai'
      GITLAB_OMNIBUS_CONFIG: |
        external_url  'http://192.168.112.134'
        gitlab_rails['gitlab_shell_ssh_port'] = 2222
        unicorn['port'] = 8888
        nginx['listen_port'] = 80
    ports: 
      - '80:80'
      - '8443:443'
      - '2222:22'
    volumes:
      - /usr/local/docker/gitlab/config:/etc/gitlab
      - /usr/local/docker/gitlab/data:/var/opt/gitlab
      - /usr/local/docker/gitlab/logs:/var/log/gitlab
运行
docker-compose up

如果显示gitlab_shell_ssh_port出错就修改如下

修改gitlab_rails['gitlab_shell_ssh_port'] = 2222为
gitlab_rails['gitlab_shell_ssh_port'] = 22222
修改    ports: 
      - '80:80'
      - '8443:443'
      - '2222:22'为
        ports: 
      - '80:80'
      - '8443:443'
      - '22222:22'

你可能感兴趣的:(docker)