- 從倉庫拉取最新的gitlab版本
docker pull gitlab/gitlab-ce 這個不好用,會無限重啟,使用下面的指令
docker search gitlab
docker pull twang2218/gitlab-ce-zh
- 創(chuàng)建對應的文件夾
mkdir /home/data/gitlab/config
mkdir /home/data/gitlab/data
mkdir /home/data/gitlab/logs
- 運行鏡像
sudo docker run --name zngitlab -d \
--hostname 192.168.11.45 \
-v /Users/admin/dev/zngitlab/config:/etc/gitlab \
-v /Users/admin/dev/zngitlab/data:/var/opt/gitlab \
-v /Users/admin/dev/zngitlab/logs:/var/log/gitlab \
-p 12222:22 -p 12345:80 -p 18433:433 \
--restart always \
--privileged=true \
twang2218/gitlab-ce-zh
配置郵箱smtp
/Users/admin/dev/zngitlab/config/gitlab.rb
gitlab_rails['gitlab_email_from'] = 'xxxxx@163.com'
gitlab_rails['gitlab_email_reply_to'] = 'xxxxx@163.com'
user['git_user_email'] = "xxxxx@163.com"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "xxxxx@163.com"
gitlab_rails['smtp_password'] = "163郵箱的授權碼"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
重新配置后生效
gitlab-ctl reconfigure
測試郵箱功能
gitlab-rails console
# liuri@lemonit.cn換成你要實際發(fā)送測試郵件的目標郵箱地址
Notify.test_email('liuri@lemonit.cn', 'LemonITCN', 'LemonITCN').deliver_now