sudo docker run -d \
--hostname localhost \
--name gitlab \
--restart always \
--publish 30001:22 --publish 30000:80 --publish 30002:443 \
--volume ~/mnt/gitlab/data:/var/opt/gitlab \
--volume ~/mnt/gitlab/logs:/var/log/gitlab \
--volume ~/mnt/gitlab/config:/etc/gitlab \
gitlab/gitlab-ce:latest
docker exec -it gitlab /bin/bash
vi /etc/gitlab/gitlab.rb
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "xx**@163.com"
gitlab_rails['smtp_password'] = "*****" // 不是邮箱的登录密码,自己设置的授权码
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
// 修改gitlab配置的发信人
gitlab_rails['gitlab_email_from'] = "xx**@163.com"
user["git_user_email"] = "xx**@163.com"
// 测试邮件服务器可用
gitlab-rails console
Notify.test_email('1107***78@qq.com', 'Message Subject', 'Message Body').deliver_now
#启动所有服务
[root@localhost gitlab]# gitlab-ctl start
#启动单独一个服务
[root@localhost gitlab]# gitlab-ctl start nginx
#查看日志,查看所有日志
[root@localhost gitlab]# gitlab-ctl tail
#查看具体一个服务的日志,类似tail -f
[root@localhost gitlab]# gitlab-ctl tail nginx