ubuntu离线安装docker及nvidia-container-toolkit

一、安装docker
1.查看当前系统版本号和名称
lsb_release -a

我这里是 Ubuntu24.04 noble

2.下载安装包
下载地址:https://download.docker.com/linux/ubuntu/dists/
查找符合版本要求的文件,如我的系统对应:https://download.docker.com/linux/ubuntu/dists/noble/pool/stable/amd64/链接下的文件。
下载下方四个文件:

containerd.io_xxx_amd64.deb
docker-ce_xxx_amd64.deb
docker-ce-cli_xxx_amd64.deb
docker-ce-rootless-extras_xxx_amd64.deb

 

3.命令行进行安装
dpkg -i ./*deb

4.配置daemon并重启docker
systemctl daemon-reload
systemctl restart docker

二、安装NVIDIA-container-toolkit
1.下载安装包
链接:https://mirror.cs.uchicago.edu/nvidia-docker/libnvidia-container/stable/
选择对应系统版本后下载文件(没有ubuntu24我下载的最新的ubuntu20.04)
上述链接不需要翻墙
文件包括:

libnvidia-container1_xxx_amd64.deb
libnvidia-container-tools_xxx_amd64.deb
nvidia-docker2_xxx_all.deb
nvidia-container-runtime_xxx_all.deb
nvidia-container-toolkit_xxx_amd64.deb

 

2.安装下载包
dpkg -i ./lib* ./nvidia*

3.重新加载daemon文件和docker
systemctl daemon-reload
systemctl restart docker

4.查看nvidia-docker 版本
nvidia-docker -v #查看版本
nvidia-docker version
dpkg -l | grep nvidia-docker #是否已安装

5.配置daemon.json
修改/etc/docker/daemon.json文件内容

“default-runtime”: "nvidia"设置docker默认运行环境为nvidia
“registry-mirrors”:镜像源代理地址(可自行百度最新地址)

{
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"registry-mirrors": [
"https://docker.1panel.live",
"https://hub.rat.dev/",
"https://docker.chenby.cn",
"https://docker.m.daocloud.io"
]
}

重新加载daemon文件和docker

systemctl daemon-reload
systemctl restart docker
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/qq_43548590/article/details/143193208

阅读剩余
THE END