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-compose up -d
3、查看docker运行情况
4、记得带/etc/hosts中加入
127.0.0.1 gitlab.example.com
5、访问,记得初始化root密码就好了
文章评论