简体   繁体   English

等效于 Rancher Desktop 中 Docker 桌面的 'host.docker.internal'

[英]Equivalent to Docker Desktop's 'host.docker.internal' in Rancher Desktop

For Docker Desktop inside a container, the DNS name host.docker.internal resolves to an IP address allowing network access to the host.对于容器内的 Docker 桌面,DNS 名称 host.docker.internal 解析为 ZA12A3079E14CED426E69A 访问主机地址。 Is there something similar when using Rancher Desktop?使用 Rancher Desktop 时是否有类似的情况?

Assuming a running container (eg the alpine image) in Docker Desktop it's possible run假设 Docker 桌面中有一个正在运行的容器(例如 alpine 映像),它可以运行

docker exec alpine-container ping -c 2 host.docker.internal

There is an open GitHub issue for it [0].它有一个开放的 GitHub 问题 [0]。 As a workaround until this is closed, a hint from a member of Rancher Labs might help (at least when running Rancher Desktop on Linux/macOS):作为解决方法,直到关闭它,来自 Rancher Labs 成员的提示可能会有所帮助(至少在 Linux/macOS 上运行 Rancher Desktop 时):

I don't think we have a symbolic name for it, but the host is always (on Linux and macOS) accessible via 192.168.5.2, which is the qemu gateway address.我不认为我们有一个符号名称,但主机总是(在 Linux 和 macOS 上)可通过 192.168.5.2 访问,这是 qemu 网关地址。 [1] [1]

[0] https://github.com/rancher-sandbox/rancher-desktop/issues/1316 [0] https://github.com/rancher-sandbox/rancher-desktop/issues/1316

[1] https://rancher-users.slack.com/archives/C0200L1N1MM/p1634568974296000?thread_ts=1634560787.294400&cid=C0200L1N1MM [1] https://rancher-users.slack.com/archives/C0200L1N1MM/p1634568974296000?thread_ts=1634560787.294400&cid=C0200L1N1MM

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

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