1.卸载旧版
sudo apt-get remove docker docker-engine docker.io containerd runc
2.安装依赖
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
3.获取GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
4.添加apt私有源
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
5.安装docker
sudo apt-get update
sudo apt-get install docker-ce
注意需要执行apt-get update不然会报错,如下图
网友评论