For Docker Desktop inside a container, the DNS name host.docker.internal resolves to an IP address allowing network access to the host. Is there something similar when using Rancher Desktop?
Assuming a running container (eg the alpine image) in Docker Desktop it's possible run
docker exec alpine-container ping -c 2 host.docker.internal
There is an open GitHub issue for it [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):
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. [1]
[0] https://github.com/rancher-sandbox/rancher-desktop/issues/1316
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.