1.卸载
sudo apt-get remove docker docker-engine docker.io containerd runc
2.更新
sudo apt-get update
3.安装依赖包
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
4 添加key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
5 设置仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
6.更新
sudo apt-get update
6.5 安装docker CE
sudo apt-get install docker-ce
7启动 docker
sudo systemctl enable docker
sudo systemctl start docker
8.测试
sudo docker run hello-world