首先,感谢有人感谢我。
这个问题,在我之前的cnblog里解决过,
最近,想重新开始,清除了之前的博客,所以又重新实操了一次。
长时间不操作这个,生疏了。
整个操作分为以下几个步骤:
一,启动gitlab-ce镜像
建议不要用8080,因为,有可能gitlab-ce里,这个端口也要提供其它服务
docker run -itd \
--publish 8443:443 \
--publish 8180:8180 \
--publish 8022:22 \
--name gitlab \
--restart unless-stopped \
-v /gitlab/etc:/etc/gitlab \
-v /gitlab/log:/var/log/gitlab \
-v /gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce
二,修改gitlab.rb文件(关键步骤,文件在/gitlab/etc/gitlab.rb)
// 修改如下语句
external_url 'http://192.168.1.111:8180'
# https需要下面这句
# nginx['redirect_http_to_https_port'] = 8180
nginx['listen_port'] = 8180
# 配置2222端口
gitlab_rails['gitlab_shell_ssh_port'] = 8022
https://blog.csdn.net/shan165310175/article/details/92797199
这个朋友,感谢了我~~
三,重新镜像
docker restart gitlab
查看/gitlab/data/gitlab-rails/etc/gitlab.yml文件(这个文件是根据gitlab.rb自动生成的,强制修改,会很麻烦),看到port为8180,基本就大功告成!
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
production: &base
#
# 1. GitLab app settings
# ==========================
## GitLab settings
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: 192.168.1.111
port: 8180
https: false
# The maximum time unicorn/puma can spend on the request. This needs to be smaller than the worker timeout.
# Default is 95% of the worker timeout
max_request_duration_seconds: 57
四,测试
2020-04-26 16_57_44-悬浮球.png
五,扫清问题,要开始gitlab CI/CD了。