赞
踩
sudo apt-get update
sudo apt upgrade
更新时间较长,请耐心等待
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
apt-get install docker-ce docker-ce-cli containerd.i
docker -v
vi /etc/docker/daemon.json
按i进入编辑模式
加入以下内容:
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://docker.m.daocloud.io",
"https://ghcr.io",
"https://mirror.baidubce.com",
"https://docker.nju.edu.cn"
]
}
按ESC键退出编辑模式,接着输入:wq,保存并退出
sudo systemctl daemon-reload
sudo systemctl restart docker
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
| sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
| sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
docker pull ollama/ollama:latest
国内镜像
docker pull dhub.kubesre.xyz/ollama/ollama:latest
docker run -d --gpus=all --restart=always -v /root/project/docker/ollama:/root/project/.ollama -p 11434:11434 --name ollama ollama/ollama
使ollama保持模型加载在内存(显存)中
docker run -d --gpus=all -e OLLAMA_KEEP_ALIVE=-1 -v /root/project/docker/ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
docker exec -it ollama ollama run qwen2
运行效果如图:
模型库
模型 | 参数数量 | 大小 | 下载方式 |
---|---|---|---|
Llama 2 | 7B | 3.8GB | docker exec -it ollama ollama run llama2 |
Mistral | 7B | 4.1GB | docker exec -it ollama ollama run mistral |
Dolphin Phi | 2.7B | 1.6GB | docker exec -it ollama ollama run dolphin-phi |
Phi-2 | 2.7B | 1.7GB | docker exec -it ollama ollama run phi |
Neural Chat | 7B | 4.1GB | docker exec -it ollama ollama run neural-chat |
Starling | 7B | 4.1GB | docker exec -it ollama ollama run starling-lm |
Code Llama | 7B | 3.8GB | docker exec -it ollama ollama run codellama |
Llama 2 Uncensored | 7B | 3.8GB | docker exec -it ollama ollama run llama2-uncensored |
Llama 2 | 13B | 7.3GB | docker exec -it ollama ollama run llama2:13b |
Llama 2 | 70B | 39GB | docker exec -it ollama ollama run llama2:70b |
Orca Mini | 3B | 1.9GB | docker exec -it ollama ollama run orca-mini |
Vicuna | 7B | 3.8GB | docker exec -it ollama ollama run vicuna |
LLaVA | 7B | 4.5GB | docker exec -it ollama ollama run llava |
Gemma | 2B | 1.4GB | docker exec -it ollama ollama run gemma:2b |
Gemma | 7B | 4.8GB | docker exec -it ollama ollama run gemma:7b |
查看自己服务器的业务端口,我们这里是30131-30140
main版本
docker run -d -p 30131:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.nju.edu.cn/open-webui/open-webui:main
cuda版本
docker run -d -p 30131:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.nju.edu.cn/open-webui/open-webui:cuda
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。