简体   繁体   中英

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. 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

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

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.

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