docker启动后,系统模型下拉框设置里面都是空 #92

Closed
opened 2026-02-16 11:19:44 -05:00 by yindo · 1 comment
Owner

Originally created by @xmbt-robert on GitHub (Mar 6, 2025).

我成功启动了所有docker镜像容器,然后开始设置接入大模型,但是设置里面的下拉框都是空值,导致我无法使用大模型接入

Originally created by @xmbt-robert on GitHub (Mar 6, 2025). 我成功启动了所有docker镜像容器,然后开始设置接入大模型,但是设置里面的下拉框都是空值,导致我无法使用大模型接入
yindo added the bug label 2026-02-16 11:19:44 -05:00
yindo closed this issue 2026-02-16 11:19:44 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 6, 2025):

@xmbt-robert 你好!我是一个可以帮助你解决bug、回答问题并成为贡献者的机器人。我会在等待人类维护者期间为你提供帮助。

下拉框为空可能是因为Ollama服务无法从Docker容器中访问。这通常是因为服务绑定到了localhost,这指的是容器本身,而不是主机或其他容器。要解决这个问题,需要将Ollama服务暴露到网络上,通过设置OLLAMA_HOST环境变量为0.0.0.0,并确保服务可以通过host.docker.internal而不是localhost访问。

对于macOS:

launchctl setenv OLLAMA_HOST "0.0.0.0"

然后重启Ollama应用。

对于Linux:
编辑systemd服务:

[Service]
Environment="OLLAMA_HOST=0.0.0.0"

然后重新加载systemd并重启Ollama:

systemctl daemon-reload
systemctl restart ollama

对于Windows:
编辑系统环境变量以设置OLLAMA_HOST,然后重启Ollama。

确保服务URL使用http://host.docker.internal:11434而不是localhost [1]

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

@dosubot[bot] commented on GitHub (Mar 6, 2025): <!-- Greeting --> @xmbt-robert 你好!我是一个可以帮助你解决bug、回答问题并成为贡献者的机器人。我会在等待人类维护者期间为你提供帮助。 <!-- Answer --> 下拉框为空可能是因为Ollama服务无法从Docker容器中访问。这通常是因为服务绑定到了`localhost`,这指的是容器本身,而不是主机或其他容器。要解决这个问题,需要将Ollama服务暴露到网络上,通过设置`OLLAMA_HOST`环境变量为`0.0.0.0`,并确保服务可以通过`host.docker.internal`而不是`localhost`访问。 对于macOS: ```bash launchctl setenv OLLAMA_HOST "0.0.0.0" ``` 然后重启Ollama应用。 对于Linux: 编辑systemd服务: ```ini [Service] Environment="OLLAMA_HOST=0.0.0.0" ``` 然后重新加载systemd并重启Ollama: ```bash systemctl daemon-reload systemctl restart ollama ``` 对于Windows: 编辑系统环境变量以设置`OLLAMA_HOST`,然后重启Ollama。 确保服务URL使用`http://host.docker.internal:11434`而不是`localhost` <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/jp/development/models-integration/ollama.md)</sup>。 <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/ac3bd727-b844-409d-b319-ff23b11716f3?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-docs-archived#92