docker-compose安装gitlab

docker安装gitlab

1、创建docker-compose.yml文件

version: '3'
services:
    gitlab:
      image: 'twang2218/gitlab-ce-zh:11.1.4'
      restart: unless-stopped
      hostname: 'gitlab.example.com'
      environment:
        TZ: 'Asia/Shanghai'
        GITLAB_OMNIBUS_CONFIG: |
          external_url 'http://gitlab.example.com'
          gitlab_rails['time_zone'] = 'Asia/Shanghai'
      ports:
        - '80:80'
        - '443:443'
        - '22:22'
      volumes:
        - config:/etc/gitlab
        - data:/var/opt/gitlab
        - logs:/var/log/gitlab
volumes:
    config:
    data:
    logs:

2、查看docker运行情况

docker-compose安装gitlab_第1张图片

3、记得带/etc/hosts中加入

127.0.0.1       gitlab.example.com

4、访问,记得初始化root密码就好了

docker-compose安装gitlab_第2张图片

你可能感兴趣的:(docker,gitlab,容器)