0

I have setup a gitlab-ce docker container inside a VM(running Ubuntu 14.4). Once I run the docker image, I am able to access it on my network as 'machinename.local' where machinename is my VM. However, I would like to(if possible) access the docker gitlab image as 'gitlab.local' instead. I've tried publishing with different ports and IP, and tried setting the external URL within the gitlab.rb file. Is there a way to do this or am I just wasting my time?

  • You are making a confusion between DNS and network connectivity. Add a DNS entry for gitlab.local if you have control over the DNS server you are using or just map it in your hosts file. – Florin Asăvoaie Aug 29 '16 at 20:48
  • @FlorinAsăvoaie You should enter that as an answer. – Xalorous Aug 30 '16 at 2:16
0

You want to publish the port (docker run -p 8080:80 ... if you wanted to publish port 8080 on the host to map to container port 80, these port numbers can be the same). Then you connect to your host ip/port to access your container service. So if your docker host is running on a VM, you'd connect to "http://vmhost:8080/", not "http://containerhost/".

  • Why did this even get an upvote. He says he IS able to access it using a different hostname. What does network connectivity even have to do with this? Ridiculous. – Florin Asăvoaie Sep 2 '16 at 21:50
  • My apologies for ruining your day by mis-reading the question. I've seen quite a few questions asking how to directly access a container from outside the host using the container name from people that don't understand how exposing ports works and mistakenly believed that was what the OP was trying to do. – BMitch Sep 2 '16 at 22:15
0

You are making a confusion between DNS and network connectivity. Add a DNS entry for gitlab.local if you have control over the DNS server you are using or just map it in your hosts file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.