sudo docker run -d \
-p 6080:80 -p 6022:22 \
--name gitlab \
--restart always \
-v /srv/gitlab/config:/etc/gitlab \
-v /srv/gitlab/logs:/var/log/gitlab \
-v /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
docker exec -it gitlab /bin/bash
vi /etc/gitlab/gitlab.rb
docker restart gitlab
# 初始root密码在登录时不能手动设置,查看日志,输出在文件
# cat /etc/gitlab/initial_root_password
# gitlab/config/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@jsdfycwlkjyxg.wecom.work"
gitlab_rails['smtp_password'] = "EfiSJYPexHjVYE2S"
gitlab_rails['smtp_domain'] = "qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_pool'] = false
docker exec -it gitlab /bin/bash
gitlab-ctl reconfigure
gitlab-ctl restart
gitlab-rails console
Notify.test_email('xxx@qq.com','gitlab邮箱通知测试','这是正文内容').deliver_now
启用如下配置
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
gitlab_rails['gitlab_email_from'] = 'gitlab@jsdfycwlkjyxg.wecom.work'
gitlab_rails['gitlab_email_display_name'] = 'Gitlab'
external_url 'https://git.xxx.com'
注意:设置external_url后,gitlab将自动将nginx开放到对应端口,https对应443,http对应80,需注意docker容器的端口映射。
更多【gitlab-Gitlab部署管理】相关视频教程:www.yxfzedu.com