欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 资讯 > Ubuntu20.04部署Dify(Docker方式)

Ubuntu20.04部署Dify(Docker方式)

2025/4/28 3:24:11 来源:https://blog.csdn.net/laonafahaodange/article/details/147544780  浏览:    关键词:Ubuntu20.04部署Dify(Docker方式)

Ubuntu20.04部署Dify(Docker方式)

  • Ubuntu20.04 Dify
    • Install Docker
    • Install Docker Compose
    • Run Dify
    • Running Ollama

由于写这篇博客的时候电脑还没装输入法,所以先用半吊子英文顶着了…关于最后运行ollama的部分可以无视,因为我修改了端口所以才需要这么运行。

Ubuntu20.04 Dify

Install Docker

sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.iosudo systemctl status docker
docker version 

Install Docker Compose

version: 2.33.1

sudo curl -L "https://github.com/docker/compose/releases/download/v2.33.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version  

Run Dify

git clone https://github.com/langgenius/dify.git
cd docker  
cp .env.example .env  
sudo docker compose up -d

problem:

Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

solution:

sudo gedit /etc/docker/daemon.json
and add:

{"registry-mirrors": ["https://docker.1ms.run","https://docker.xuanyuan.me"]
}
sudo systemctl daemon-reload
sudo systemctl restart docker

url: http://localhost/install

Running Ollama

I changed the port and found something…
this is my ollama service config file:

[Unit]
Description=Ollama Service
After=network-online.target[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"
Environment="OLLAMA_HOST=0.0.0.0:11451"
OLLAMA_SCHED_SPREAD=1[Install]
WantedBy=default.target

I need to run ollama like this:OLLAMA_HOST=127.0.0.1:11451 ollama run qwq, it works, but why???


Reference:

  • 如何在 Ubuntu 20.04 上安装和使用 Docker
  • 最新2025年docker 出现无法拉取docker: Error response from daemon: Get “https://registry-1.docker.io/v2/”: net/等问题
  • Docker/DockerHub 国内镜像源/加速列表(3月6日更新-长期维护)

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词