podman的OpenSearch仪表板得出错误的IP
我有一个带有大量IP的计算机X,用OpenSearch进行了Podman-Compose,OpenSearch仪表板将图像链接到错误的(未接触)IP。我试图强制IP,但是如果这样做,Podman-Compose会破裂。我该怎么办?
我试图在docker-compose.yml中添加一个IPv4,每当我发现0.0.0.0时,我都试图修改图像并强制正确的IP,但它一直在破裂。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Docker / Podman容器IP无法从外部客户端访问。
您需要将TCP或UDP端口从容器中曝光到主机系统,然后客户将连接到:。
主机端口和容器端口不需要是同一端口。
即,您可以使用端口80运行多个Web服务器容器,但是您需要在主机OS上选择其他服务不使用的主机端口来端口映射到容器中。即80-> 80,81-> 80,8080-> 80等。
一旦您在容器配置中创建端口定义后,Podman将处理从主机转发到容器的端口。
您可能需要打开主机防火墙上的端口,以允许客户连接。 0.0.0.0是代表本地主机的另一种方式。
假设您的主机为10.1.1.20,您的OpenSearch仪表板容器为172.16.8.4,您的仪表板Web应用程序配置为在端口5001/TCP上收听。
您将需要docker-compose.yml文件中的端口指令才能将主机端口5001映射到类似于下面的容器端口5001。
容器:
OpenSearch-dashboard:
端口:
- “ 5001:5001”,
只要您的主机防火墙上允许端口5001,客户应该能够使用
Docker / Podman container IPs are not accessible from external clients.
You need to expose TCP or UDP ports from your container to the host system and then clients will connect to :.
The host port and the container port do not need to be the same port.
i.e. you can run multiple web server containers all using port 80 however you will need to pick unique ports on your host OS that are not used by other services to port-map to the containers. i.e 80->80, 81->80, 8080->80 etc.
Once you create the port definitions in your container configuration Podman will handle the port forwarding from the host to the container.
You might need to open the ports on the host firewall to allow clients to connect. 0.0.0.0 is another way of representing the local host.
Let say your host is 10.1.1.20 and your OpenSearch Dashboards container is 172.16.8.4 and your dashboard web app is configured to listen on port 5001/TCP.
You will need a ports directive in your docker-compose.yml file to map the host port 5001 to the container port 5001 similar to the below.
containers:
opensearch-dashboard:
ports:
- "5001:5001"
As long as port 5001 is permitted on your host firewall, the client should be able to connect using https://10.1.1.20:5001/