'GitLab CE Docker - empty response when using other port than 80
I have installed latest GitLab Community Edition Docker image. Environment is macOS (High Sierra) with Docker Community Edition installed.
I have followed the instruction here for how to start the GitLab image: https://docs.gitlab.com/omnibus/docker/
I have not done any modifications within the running container (e.g. not changed the gitlab.rb file), just started the image from the host.
Things seem to work well if I use the default ports, e.g. 80 for HTTP, e.g.
sudo docker run --detach \
--hostname gitlab.example.com \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.example.com'; gitlab_rails['gitlab_shell_ssh_port'] = 22;" \
--publish 192.168.0.119:443:443 \
--publish 192.168.0.119:80:80 \
--publish 192.168.0.119: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
I want to run GitLab on non-standard ports, e.g. 10080 for HTTP, so modify the docker command to this:
sudo docker run --detach \
--hostname gitlab.example.com \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://gitlab.example.com:10080'; gitlab_rails['gitlab_shell_ssh_port'] = 22;" \
--publish 192.168.0.119:443:443 \
--publish 192.168.0.119:10080:80 \
--publish 192.168.0.119: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
But that results in "empty reply from server" when trying to access the GitLab dashboard with a Web browser or curl, here is curl run:
$ curl -v http://192.168.0.119:10080
* Rebuilt URL to: http://192.168.0.119:10080/
* Trying 192.168.0.119...
* TCP_NODELAY set
* Connected to 192.168.0.119 (192.168.0.119) port 10080 (#0)
> GET / HTTP/1.1
> Host: 192.168.0.119:10080
> User-Agent: curl/7.58.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host 192.168.0.119 left intact
curl: (52) Empty reply from server
I can also run lsof to verify that the GitLab docker container is indeed listening on the port
$ lsof -nP -i4TCP:10080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.docke 890 jo 19u IPv4 0x871834297e946edb 0t0 TCP 192.168.0.119:10080 (LISTEN)
To verify that port 10080 is usable, I have run other apps listening on it, and they work as expected.
Anyone else run into this, or have suggestions for what the reason might be, or options to try out?!
Cheers -jo
Solution 1:[1]
Can't believe this has been unanswered for 3 years
Change: 'http://gitlab.example.com:10080' to 'http://localhost:80'
That url needs to reflect the internal port, not the mapped one, and it should be the actual url. localhost works. ip address. Whatever your hostname is will work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pete |
