sudo systemctl stop docker
sudo apt-get purge docker-ce
sudo rm -rf /var/lib/docker
sudo rm -rf /etc/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
第一条命令将删除/var/lib/docker目录,这是Docker运行期间生成容器镜像、容器等文件的位置。
第二条命令将删除/etc/docker目录,这是Docker的配置文件位置。
第三个命令将删除AppArmor策略。
最后一个命令将删除Docker用户组。
sudo apt-get remove docker-ce-cli
sudo apt-get autoremove -y
第一条命令将从存储库中删除Docker CE CLI。
第二条命令将自动删除依赖项。
现在,您已成功地从您的系统中删除了Docker。
sudo docker -v
cat /etc/product-info
cat /etc/os-version
该系统是基于debian 10.x (代号 buster) 构建。官方Docker安装方法不会认识UOS操作系统,需要手动修改配置。
查看UOS基于debian的版本:
cat /etc/debian_version
sudo apt-get update
备份原来系统源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
写入阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
sudo vi /etc/apt/sources.list
填入上面阿里源 wq!保存退出
sudo apt-get update
最后,下载curl
sudo apt-get install curl
这里试着解决ssl验证问题,绕过ssl验证的方法如下:
echo "Acquire::https::Verify-Peer "false";" >> /etc/apt/apt.conf.d/80ssl-exceptions
echo "Acquire::https::Verify-Host "false";" >> /etc/apt/apt.conf.d/80ssl-exceptions
若遇到权限问题则su - 切换root再操作
添加证书
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
检查是否添加成功,显示信息如下
sudo apt-key fingerprint 0EBFCD88
echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
Docker 成功运行!
sudo docker -v
sudo apt-get install nvidia-docker2 -y
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker load <
sudo docker run --shm-size=16G --runtime=nvidia -itd -p 19008:8080 -p 16379:16379 rstdetect:v2.7.mysql.autorun
搞定收工!