我直接長話短說
sudo docker run -d \
--name open-webui \
--network ai-local-net \
-p 127.0.0.1:3000:8080 \
--add-host=host.docker.internal:host-gateway \
--env-file /etc/open-webui/secret.env \
-v open-webui-data:/app/backend/data \
--restart unless-stopped \
ghcr.io/open-webui/open-webui:main
這段,是用image生出container時的指令。
我強制不用host,要webui和ollama傳資料時,只能用自定義的bridge「ai-local-net 」
而secret.env,是設定環境的檔案
而這個環境的檔案裡,需要設一段環境變數
OLLAMA_BASE_URL=http://host.docker.internal:11434
我的問題在於
OLLAMA_BASE_URL=http://host.docker.internal:11434
這一段
和上方這一段
--add-host=host.docker.internal:host-gateway
兩者「本質上」的差異到底在哪?
我有問ai了,仍然沒有非常清楚
原本我想隨便看過,但是這兩者的差異我沒有非常清楚,以至於後續的偵錯,模模糊糊不太能釐清
希望大神能點醒小弟
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.136.251.94 (臺灣)
※ 文章網址: https://webptt.cc/bbs/Gossiping/M.1776334055.A.1AA.html
推文 (12)
推
POWERSERIES
你沒有打hello world
39.15.16.113 04/16 18:16
→
hosen
sudo rm -rf /
42.79.29.208 04/16 18:24
推
s37166117
問錯版了啊哥
101.14.11.251 04/16 18:26
推
Serisu
BASE_URL 是網頁轉址的基礎字串吧
101.10.168.212 04/16 18:31
→
kuinochi
先去看docker document
223.137.170.214 04/16 18:37
推
jhjhs33504
一個不是給人看的 另一個是給人看的
1.162.116.181 04/16 18:40
推
MrCool5566
你的 webui 跟 ollama 是兩台獨立機器
223.137.92.127 04/16 18:48
→
MrCool5566
互相打不到啊 所以要 加 --add-host
223.137.92.127 04/16 18:49
→
MrCool5566
跟 docker 說 要開成 host,這樣你的容
223.137.92.127 04/16 18:49
→
MrCool5566
器就指定 host + port 就能打到另一個
223.137.92.127 04/16 18:49
→
MrCool5566
容器了
223.137.92.127 04/16 18:49
→
pennyleo
Mrcool 您講的讓我豁然開朗了!
114.136.251.94 04/16 18:54