ubuntu系统离线安装docker20.10.7版本及nvidia-container-runtime3.11.0-1版本(离线安装nvidia-docker)

1.下载3个docker相关安装包

containerd.io_1.4.6-1_amd64.deb

docker-ce-cli_20.10.7~3-0~ubuntu-xenial_amd64.deb

docker-ce_20.10.7~3-0~ubuntu-xenial_amd64.deb

下载网址:https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/

ubuntu系统离线安装docker20.10.7版本及nvidia-container-runtime3.11.0-1版本(离线安装nvidia-docker)_第1张图片

2.依次执行安装,顺序不要错

sudo dpkg -i containerd.io_1.4.6-1_amd64.deb
sudo dpkg -i docker-ce-cli_20.10.7~3-0~ubuntu-xenial_amd64.deb
sudo dpkg -i docker-ce_20.10.7~3-0~ubuntu-xenial_amd64.deb

3.查看docker版本信息

docker version

4.下载4个nvidia--container-runtime3.11.0-1相关安装包

nvidia-container-toolkit-base_1.11.0-1_amd64.deb

libnvidia-container1_1.11.0-1_amd64.deb

libnvidia-container-tools_1.11.0-1_amd64.deb

nvidia-container-toolkit_1.11.0-1_amd64.deb

下载网址:http://mirror.cs.uchicago.edu/nvidia-docker/libnvidia-container/stable/ubuntu16.04/amd64/
ubuntu系统离线安装docker20.10.7版本及nvidia-container-runtime3.11.0-1版本(离线安装nvidia-docker)_第2张图片

5.依次执行安装,顺序不要错

sudo dpkg -i nvidia-container-toolkit-base_1.11.0-1_amd64.deb
sudo dpkg -i libnvidia-container1_1.11.0-1_amd64.deb
sudo dpkg -i libnvidia-container-tools_1.11.0-1_amd64.deb
sudo dpkg -i nvidia-container-toolkit_1.11.0-1_amd64.deb

6.重启docker服务

sudo systemctl restart docker

7.sh一键安装脚本参考

#安装docker
sudo dpkg -i containerd.io_1.4.6-1_amd64.deb
sudo dpkg -i docker-ce-cli_20.10.7~3-0~ubuntu-xenial_amd64.deb
sudo dpkg -i docker-ce_20.10.7~3-0~ubuntu-xenial_amd64.deb
#安装nvidia-docker
sudo dpkg -i nvidia-container-toolkit-base_1.11.0-1_amd64.deb
sudo dpkg -i libnvidia-container1_1.11.0-1_amd64.deb
sudo dpkg -i libnvidia-container-tools_1.11.0-1_amd64.deb
sudo dpkg -i nvidia-container-toolkit_1.11.0-1_amd64.deb
#使普通用户具有docker权限
sudo chmod a+rw /var/run/docker.sock
sudo usermod -aG docker sne
sudo systemctl restart docker
#加载算法镜像
docker load -i ubuntu18.04.tar
echo "docker install ok"

#将算法程序及依赖库解压到宿主机上
tar -xvf Detect.tar -C /home/***/

#创建算法容器,算法自启
docker run -d --gpus all --name camera -v /home/***/Detect:/home/***/Detect -v /etc/localtime:/etc/localtime:ro --ipc=host --net=host --restart=always camera:v2
echo "camera start"

你可能感兴趣的:(docker容器,ubuntu,docker,容器,linux,运维)