目录
[root@junmo gitLab]
.
├── config
├── data
├── gitLab.yml
├── logs
└── pass.txt3 directories, 2 files
[root@junmo gitLab]
docker-compose.yml 文件
version: '2'
services:gitlab:image: twang2218/gitlab-ce-zhrestart: alwayshostname: gitlab container_name: gitlabprivileged: true ports:- 9080:80- 9443:9443- 58522:58522- 9022:9022volumes:- ./config:/etc/gitlab- ./data:/var/opt/gitlab- ./logs:/var/log/gitlabenvironment:TZ: 'Asia/Shanghai'GITLAB_OMNIBUS_CONFIG: |external_url 'http://gitlab' gitlab_rails['time_zone'] = 'Asia/Shanghai'gitlab_rails['gitlab_shell_ssh_port'] = 58522gitlab_rails['smtp_enable'] = truegitlab_rails['smtp_address'] = "smtp.163.com"gitlab_rails['smtp_port'] = 465gitlab_rails['smtp_user_name'] = "XXXX@163.com" gitlab_rails['smtp_password'] = "XXXXX" gitlab_rails['smtp_domain'] = "163.com"gitlab_rails['smtp_authentication'] = "login"gitlab_rails['smtp_enable_starttls_auto'] = truegitlab_rails['smtp_tls'] = truegitlab_rails['gitlab_email_from'] = 'XXXX@163.com'
启动
docker-compose -f mongodb.yml up -d
docker-compose -f mongodb.yml down
docker-compose -f mongodb.yml restart
注意
访问 IP:9080
启动太慢,等待时间太长
docker 安装gitlab
docker run -d --hostname=localhost --restart=always \
--name gitlab --privileged=true \
-p 9443:443 -p 9080:80 -p 9022:22 -p 58522:58522 \
-v /opt/softs/docker-compose/gitLab/config:/etc/gitlab:Z \
-v /opt/softs/docker-compose/gitLab/logs:/var/log/gitlab:Z \
-v /opt/softs/docker-compose/gitLab/data:/var/opt/gitlab:Z \
twang2218/gitlab-ce-zh