rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.7k stars 267 forks source link

open-webui container not able to connect to the service running on the host machine #6987

Open gunamata opened 1 month ago

gunamata commented 1 month ago

Actual Behavior

open-webui container not able to connect to the service running on the host machine

Steps to Reproduce

docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui -e WEBUI_AUTH=False --restart always ghcr.io/open-webui/open-webui:main

Result

The open-webui container is not able to access the ollama service (running on port 11434) running on the host machine. I tried host.docker.internal as well but with no luck!

Expected Behavior

The open-webui container should be able to access the ollama service running on the host machine

Additional Information

I have Networking tunnel enabled.

Rancher Desktop Version

1.14

Rancher Desktop K8s Version

1.29.3

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 10

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No response

gunamata commented 1 month ago

Removing --add-host=host.docker.internal:host-gateway in the command solves the problem. I am not sure if it's the flag --add-host or the value passed that's problematic. Any thoughts @Nino-K ?

Nino-K commented 1 month ago

I believe the host-gateway is specific to the docker desktop, that is why removing the flag simply works. If you replace the host-gateway with the internal IP address of the host machine, that should solve the problem.

jandubois commented 1 month ago

We should see if we can add support for it. There are other open issues referencing gateway.docker.internal that I think will have the same root issue.