5

I'm running GitLab on my machine by using the docker image. On this machine I have several other services. So the machine Port 80 is already taken by something else. So I did this port mapping 9088:80 ... now I face the problem that Gitlab still thinks for external requests it runs on port 80 and also the runner stuck because:

So it uses http://psmonster/ instead of http://psmonster:9088/

Checking for jobs... received                       job=39 repo_url=http://psmonster/edi-tools/xsltestsuite.git runner=_z9oqvay
WARNING: Job failed: exit status 1                  duration=155.353588ms job=39 project=9 runner=_z9oqvay
WARNING: Failed to process runner                   builds=0 error=exit status 1 executor=shell runner=_z9oqvay

Does somebody know how to handle this?

7
  • Which port did you change...? there should be 3 publish option for the running command. Commented Dec 4, 2019 at 14:11
  • It was just by runnig: sudo docker run --detach \ --hostname gitlab.example.com \ --publish 30443:443 --publish 9088:80 --publish 30022:22 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest Commented Dec 4, 2019 at 14:14
  • There should be options like this.. --publish 443:443 --publish 9080:80 --publish 22:22 which one did you change? Commented Dec 4, 2019 at 14:15
  • 9080 is taken by sonarqube ... but using 9080 will also cause this issue Commented Dec 4, 2019 at 14:16
  • It's a Mac? or Linux? Commented Dec 4, 2019 at 14:19

1 Answer 1

5

Please check out

you need to alter your config file.


Let us assume you start your gitlab container like this

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 --publish 22:22 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab \
  --volume /srv/gitlab/logs:/var/log/gitlab \
  --volume /srv/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

this will create the config on your host machine in the folder srv/gitlab/config

Alter the config file from

external_url "https://gitlab.example.com:80"

to

external_url "https://psmonster:9088"

delete your container - since you do not have a use for the current one

docker rm -f gitlab

and start it again, however this time around the config files already exists and can be used by the container. Therefore it will use the proper port and you do not run into the port issue you described in your question. Please note the updated port definition

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 9088:9088 \
  --name gitlab \
  --restart always \
  --volume /srv/gitlab/config:/etc/gitlab \
  --volume /srv/gitlab/logs:/var/log/gitlab \
  --volume /srv/gitlab/data:/var/opt/gitlab \
  gitlab/gitlab-ce:latest

general docs on how to use the gitlab docker image can be found here

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks that was really great!!
Can't we just restart the running container?
How would you do this, if you use docker-compose?
Use sudo docker restart gitlab instead of docker rm -f gitlab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.