简体   繁体   English

在端口 80 ERR_CONNECTION_REFUSED 上运行 Gitlab Docker 容器

[英]Running Gitlab Docker Container on port 80 ERR_CONNECTION_REFUSED

I'm beyond confused as to why I'm getting an error 'ERR_CONNECTION_REFUSED' when I try running a Gitlab docker container on port 80, but if I change the port number to 8000, it totally works.当我尝试在端口 80 上运行 Gitlab docker 容器时,我对为什么会收到错误“ERR_CONNECTION_REFUSED”感到非常困惑,但是如果我将端口号更改为 8000,它完全可以工作。

I've scoured the internet for four days looking for answers, but the only thing I've seen suggested is the container is missing an SSL cert for the domain name.我已经在互联网上搜索了四天以寻找答案,但我看到的唯一建议是容器缺少域名的 SSL 证书。 However, the container works just fine if I switch the port to 8000. Can anyone please liberate me from this frustration and explain why 8000 is OK and 80 is not?但是,如果我将端口切换到 8000,容器就可以正常工作。谁能让我摆脱这种挫败感并解释为什么 8000 可以而 80 不行?

Code that doesn't work:不起作用的代码:

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

Code that does work:有效的代码:

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

It's the same exact code, the only difference is the one port number.这是完全相同的代码,唯一的区别是一个端口号。

Well, apparently the answer to this question is patience.好吧,显然这个问题的答案是耐心。 For some reason, when on port 8000 it only took about 2 minutes for the server to prepare itself.出于某种原因,在端口 8000 上,服务器只需要大约 2 分钟就可以自行准备。 When using port 80, it took over 10 minutes to prepare itself.使用端口 80 时,需要 10 多分钟才能自行准备。 Not exactly sure why that is, but it's working now.不完全确定为什么会这样,但它现在正在工作。 So frustrating.太令人沮丧了。 I had blown away the container because it wasn't working fast enough, then tried again.我把容器炸掉了,因为它工作得不够快,然后又试了一次。

I find most of my questions on here to be answered the same way.我发现我在这里的大部分问题都以同样的方式得到回答。 Patience.耐心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM