mirror of
https://github.com/langgenius/dify-docs-archived.git
synced 2026-07-16 02:28:21 -04:00
zh_CN/learn-more/use-cases/private-ai-ollama-deepseek-dify.md 文档疑问 #56
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 @jrsnd on GitHub (Feb 10, 2025).
在常见问题中,官方针对上述问题的Windows解决方案,似乎未能解决Ollama 服务在 Docker 容器中无法访问的问题。
经过本人实操,使用了macOS 环境配置方法,反倒解决了 Windows上Docker 部署时的连接错误。
**如果以上步骤无效,可以使用以下方法:
问题是在 docker 内部,你应该连接到 host.docker.internal,才能访问 docker 的主机,所以将 localhost 替换为 host.docker.internal 服务就可以生效了:
http://host.docker.internal:11434**
以上如有问题还请指正,盼复。
@dosubot[bot] commented on GitHub (Feb 10, 2025):
Hello, @jrsnd! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together!
To resolve the connection error when using Dify and Ollama in a Docker container on Windows, you should indeed replace
localhostwithhost.docker.internal. This allows the Docker container to access services running on the host machine. The correct URL to use is:This change is necessary because
localhostwithin a Docker container refers to the container itself, not the host machine. By usinghost.docker.internal, you can correctly route the connection to the host's network services. Additionally, ensure that theOLLAMA_HOSTenvironment variable is set to0.0.0.0to allow connections from Docker [1][2].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other