前提安装docker:请移步这里安装:https://blog.csdn.net/qq_42869878/article/details/81383928?spm=1001.2014.3001.5501
```python
$ mkdir /home/docker/gitlab -p
$ GITLAB_HOME=/home/docker/gitlab
$ docker run -d \
-p 6443:443 \
-p 6080:6080 \
-p 6022:22 \
--name gitlab \
--restart always \
-v /home/docker/gitlab/config:/etc/gitlab \
-v /home/docker/gitlab/logs:/var/log/gitlab \
-v /home/docker/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:11.8.0-ce.0
docker exec -it gitlab vim /etc/gitlab/gitlab.rb
修改文件
external_url "http://xx.com:6080"
gitlab_rails['gitlab_shell_ssh_port'] = 6022
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xx@qq.com"
gitlab_rails['smtp_password'] = "notice-IOT2018"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'xx@qq.com'
gitlab_rails['smtp_domain'] = "exmail.qq.com"
nginx['listen_port'] = 6080
重启gitlab
docker restart gitlab