关闭docker
sudo systemctl stop docker
卸载旧版本:
sudo apt purge docker-ce
安装新版本
sudo apt update
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
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-cache madison docker-ce
sudo apt install docker-ce=5:19.03.15~3-0~ubuntu-bionic
sudo docker info
安装nvidia-docker
sudo apt update
sudo apt install nvidia-docker2
转载于:https://blog.csdn.net/weixin_30414305/article/details/101669345