mirror of
https://github.com/langgenius/dify-docs-archived.git
synced 2026-07-25 05:25:44 -04:00
虚拟机上用 docker 装了 dify 。大模型装在 windows 宿主机上。调不通 #123
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ucer on GitHub (Mar 23, 2025).
##项目环境
问题说明
无法配置 ollama 模型,连接超时
在 windows 上 ollama 服务 正常
windows 防火墙已放开,进入虚拟机容器能正常访问http://192.168.0.104:11434
@dosubot[bot] commented on GitHub (Mar 23, 2025):
@Ucer 你好!我是Dosu,一个可以帮助你解决 bug、回答问题并成为贡献者的机器人。我会在这里帮助你,等待人类维护者。
I found similar open issues that might help resolve your connection timeout problem when configuring the Ollama model in a Docker environment on a virtual machine:
Issue with Timeout Error: One solution suggests ensuring that the Ollama service is accessible from the Docker container. This involves setting the
OLLAMA_HOSTenvironment variable to0.0.0.0to expose the service to the network. Additionally, replacelocalhostwithhost.docker.internalin your service configuration to ensure Docker can access the host network [1].Connection Error on Windows: Another solution for a similar issue on Windows involves replacing
localhostwithhost.docker.internalto allow the Docker container to access services running on the host machine. Ensure theOLLAMA_HOSTenvironment variable is set to0.0.0.0[2].To resolve your issue, try the following steps:
Replace
localhost: Usehost.docker.internalinstead oflocalhostin your configuration to allow the Docker container to access the Ollama service running on the Windows host.Set Environment Variable: Ensure the
OLLAMA_HOSTenvironment variable is set to0.0.0.0on your Windows host to bind the service to all network interfaces.These steps should help you configure the Ollama model and resolve the connection timeout issue.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
@ccHonglin commented on GitHub (Apr 1, 2025):
我有相同的问题,我ollama部署在windows中,dify通过wsl2中的docker安装,无法访问ollama的模型