参考链接:https://yq.aliyun.com/articles/110806
为了速度,这里使用的是阿里的镜像,没有使用官方的。
# step 1: 安装必要的一些系统工具
sudo apt-get updatesudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
echo "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/debian stretch stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
#如果使用参考链接中的命令,会出现无法更新源的问题
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce