Reputation: 31
I use docker install gitlab.
Step 1:
docker run -d
-p 8023:443
-p 8020:80
-p 8022:22
--name gitlab
--restart always
-v /home/gitlab/config:/etc/gitlab
-v /home/gitlab/logs:/var/log/gitlab
-v /home/gitlab/data:/var/opt/gitlab
gitlab/gitlab-ce
step 2:
vi /home/gitlab/config/gitlab.rb
external_url 'http://192.168.71.5'
gitlab_rails['gitlab_ssh_host'] = '192.168.71.5'
gitlab_rails['gitlab_shell_ssh_port'] = 8022
step 3:
docker exec -it gitlab /bin/bash
gitlab-ctl reconfigure
docker restart gitlab
When I add a new project new-test in gitlab. Then open http://192.168.71.5:8020/root/new-test with chrome. The Clone with HTTP is http://192.168.71.5/root/new-test.git. when use git clone http://192.168.71.5/root/new-test.git. There is something wrong.
fatal: unable to access 'http://192.168.71.5/root/new-test.git/': Failed connect to 192.168.71.5:80; Connection refused
enter image description here
why the Clone with HTTP is not http://192.168.71.5:8022/root/new-test.git?
Upvotes: 2
Views: 1078
Reputation: 1168
You have to change the value of 'external_url' in gitlab.rb to include the portnumber. This will also be reflected in the http(s) clone url.
Note that in the last scentence of your question you use port 8022 (which is the ssh port). This probably should be 8020.
Pay attention that when changing the value of 'external_url', this will cause nginx to start listening on this same port. So you have to configure the ports of your docker container like the following:
-p 8023:443 -p 8020:8020 -p 8022:22
Upvotes: 1
Reputation: 11802
-p 8023:443
-p 8020:80
-p 8022:22
should be
docker run -d
-p 443:8023
-p 80:8020
-p 22:8022
Upvotes: 0