docker --version
#还没有docker
cat /proc/version
sudo apt install docker.io
docker --version
#Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.1
sudo usermod -aG docker $USER
sudo docker info
vi /etc/docker/daemon.json#镜像,root
#添加
{"registry-mirrors":["https://reg-mirror.qiniu.com/"]}
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
# 更新源
sudo apt-get update
#(注意选择自己的cuda版本)
docker run --runtime=nvidia --rm nvidia/cuda:11.2-base nvidia-smi
linux ubuntu 安装docker,nvidia-docker
最新推荐文章于 2022-10-30 15:29:26 发布