文章来源:https://www.cnblogs.com/hello-tl/p/9267406.html
1.拉取镜像
# docker pull gitlab/gitlab-ce
2.启动
# docker run --detach --hostname www.xxx.com --publish 1111:1111 --publish 2289:22 --name gitlab --restart always --volume /data/gitlab/config:/etc/gitlab --volume /data/gitlab/logs:/var/log/gitlab --volume /data/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce
3.修改gitlab.rb
docker exec -it gitlab vim /etc/gitlab/gitlab.rb ###### 查找一下两个设置 打开注释并修改 external_url “http://192.168.1.172:1111” gitlab_rails['gitlab_shell_ssh_port'] = 2289
4.打开端口
# systemctl start firewalld # firewall-cmd --zone=public --add-port=1111/tcp --permanent # firewall-cmd --zone=public --add-port=80/tcp --permanent # firewall-cmd --zone=public --add-port=443/tcp --permanent # firewall-cmd --zone=public --add-port=2289/tcp --permanent # systemctl restart firewalld.service
5.最后浏览器中访问 http://192.168.1.172:1111