docker下使用gitlab
docker run --detach
--publish 8443:443
--publish 8090:80
--publish 8022:22
--name gitlab
--restart unless-stopped
--hostname 10.1.16.140
-v $PWD/etc:/etc/gitlab
-v $PWD/log:/var/log/gitlab
-v $PWD/data:/var/opt/gitlab
-v /etc/localtime:/etc/localtime:ro
gitlab/gitlab-ce
添加邮件配置,qqmail
sudo vi ~/gitlab/etc/gitlab.rb#搜索找到包含smtp的,被全部注释掉的一段,再下面贴入,邮件账号和密码按实际填写
gitlab_rails["smtp_enable"] = true
gitlab_rails["smtp_address"] = "smtp.exmail.qq.com"
gitlab_rails["smtp_port"] = 465
gitlab_rails["smtp_user_name"] = "1@1.com"
gitlab_rails["smtp_password"] = "pass"
gitlab_rails["smtp_authentication"] = "login"
gitlab_rails["smtp_enable_starttls_auto"] = true
gitlab_rails["smtp_tls"] = true
gitlab_rails["gitlab_email_from"] = "1@1.com"
gitlab_rails["smtp_domain"] = "1.com"
gitlab_rails["gitlab_email_reply_to"] = "1@1.com"
保存退出后,进入docker内部,进行reconfig,大概30秒
docker exec -it gitlab bashgitlab-ctl reconfigure
完成后,测试一下,还是再docker内部,进入控制台
gitlab-rails consoleNotify.test_email("wayne@qq.com", Message Subject", "Message Body").deliver_now
如果wayne@qq.com能收到测试邮件表示成功
修改地址
sudo vi ~/gitlab/data/gitlab-rails/etc/gitlab.yml将host的ip改为docker外部ip,这个一般是正确不用改的
将port的80改为docker的外部端口,是8090
进入docker内部重启
docker exec -it gitlab bashgitlab-ctl restart
以上是 docker下使用gitlab 的全部内容, 来源链接: utcz.com/z/513393.html