繁体   English   中英

Gitlab Docker 容器中的防火墙设置

[英]Firewall settings in a Gitlab Docker container

我在 Docker 容器中运行 GitLab 并想按照这些说明配置 https。 为此,我在 Powershell 中使用以下命令调用了终端:

docker exec -ti -u root b836c4cdfd37 bash

输入命令sudo ufw allow https后,显示如下错误信息:

WARN: initcaps
[Errno 2] iptables v1.8.4 (legacy): can't initialize iptables table `filter': Permission denied (you must be root)
Maybe iptables or your kernel needs to be upgraded.

Skipping adding existing rule
Skipping adding existing rule (v6)

如何正确执行 sudo ufw allow https 命令?

The instructions you are following are for installing GitLab directly on an Ubuntu host, not running GitLab inside of a docker container, which requires a different set of installation and networking steps. 在您的场景中, ufw将无法按照您所遵循的指南中的说明工作,因为 docker 默认情况下管理容器的网络。 Docker 的网络可能会干扰尝试使用ufwiptables管理防火墙配置。 即使您设法使命令正常工作,您也会发现 docker 的网络管理可以绕过您容器中的 ufw 配置

要在 docker 中安装 GitLab,应遵循官方 docker 安装说明 您还可以查看 GitLab 的所有其他安装方法以获取更多上下文。

If you really want to continue installing gitlab "manually" inside of a container, just skip the UFW steps and make sure you have configured port mapping for the GitLab container from the docker host (eg to map http/https, docker run -p 80:80 -p 443:443... )。

暂无
暂无

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

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