https://rancher.com/ logo
m

many-plastic-16454

07/15/2022, 10:40 PM
I'm using Rancher Desktop 1.4.1 on M1 Mac, and using Moby. I'm just trying to connect to the host application from container. I think I'm missing something super simple. I run
docker run -it --rm --add-host=host.docker.internal:host-gateway debian:latest bash
and on the host side, I'm running
python3 -m http.server 9876
. So on the container, I installed telnet and
telnet host.docker.internal 9876
but unable to connect. What am I missing?
f

fast-garage-66093

07/16/2022, 1:01 AM
Please try it without the
--add-host
option; the name should already be defined inside the container. And on macOS the address will always be
192.168.5.2
, so you could try that as well, but
host.docker.internal
should already be an alias for it.
12 Views