Port configuration broken (?) out of the box for Docker Gitlab Omnibus images
I have an issue similar to #1249 (closed) for fresh Docker images, created according to instructions under https://gitlab.com/gitlab-org/gitlab-ce/tree/master/docker. In particular, projects can't be checked out with the URLs shown by Gitlab, because those URLs use the wrong ports.
I see two possibilities:
— I'm doing something wrong, because I'm a Docker newbie. — Docker images are set up incorrectly out of the box, and the needed setup is not documented.
Which is it?
Hosts: one physical server (let's say my.example.host
), and the Docker virtual machine on it.
Scenario: After install, Gitlab was running on our Docker virtual machine on port 80, and this was exposed on the host (my.example.host
) on port 8080. I set external_url
to the host's hostname my.example.host
and rebooted the image.
Problem: Gitlab showed HTTP checkout URLs connected to http://my.example.host/... (or https?), thus to port 80 on the host, which does not work. I want those URLs to show port 8080 instead.
Attempted solution: I tried changing external_url to use port 8080, but as documented, changing the port in external_url lead to breakage (I couldn't quickly figure out what happened), so I couldn't fix the issue.
Moreover, out of the box, there's the same issue for SSH, but I was able to fix that by setting gitlab_rails['gitlab_shell_ssh_port'] = 2222
inside /etc/gitlab/gitlab.rb
.
Temporary workaround: expose Gitlab on port 80, and disable the host server on 80. But this doesn't scale — I need now a test Gitlab instance on the same server, since that's my only server.
#1249 (closed) talks about nginx['listen_port'], but that's not documented under https://gitlab.com/gitlab-org/gitlab-ce/tree/master/docker (AFAIK). It's also not clearly documented in that issue: Is that supposed to be the internal port number or the external one? Does this parameter default to 8080? I mean, the name suggests clearly it's the internal port number, but why should I care? Or is the parameter misnamed and undocumented?