【问题标题】:Running Gitlab Docker Container on port 80 ERR_CONNECTION_REFUSED在端口 80 ERR_CONNECTION_REFUSED 上运行 Gitlab Docker 容器
【发布时间】:2021-02-24 08:05:05
【问题描述】:

当我尝试在端口 80 上运行 Gitlab docker 容器时,为什么会收到错误“ERR_CONNECTION_REFUSED”,我非常困惑,但如果我将端口号更改为 8000,它完全可以工作。

我已经在互联网上搜索了四天以寻找答案,但我看到的唯一建议是容器缺少域名的 SSL 证书。但是,如果我将端口切换到 8000,容器就可以正常工作。谁能让我摆脱这种挫败感并解释为什么 8000 可以而 80 不行?

无效的代码:

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

有效的代码:

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

完全相同的代码,唯一的区别是一个端口号。

【问题讨论】:

    标签: docker ssl gitlab containers podman


    【解决方案1】:

    嗯,显然这个问题的答案是耐心。出于某种原因,在端口 8000 上,服务器只需要大约 2 分钟就可以自行准备。使用端口 80 时,需要 10 多分钟才能自行准备。不完全确定为什么会这样,但它现在正在工作。太令人沮丧了。我把容器炸掉了,因为它工作得不够快,然后又试了一次。

    我发现我在这里的大部分问题都以同样的方式得到回答。耐心。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-18
      • 1970-01-01
      • 2015-09-28
      • 1970-01-01
      • 2011-06-16
      • 1970-01-01
      • 2019-10-19
      • 1970-01-01
      相关资源
      最近更新 更多