【发布时间】: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