换阿里源参考https://www.cnblogs.com/sunlingC/p/11120434.html
Install using the repository
1)sudo apt-get update
2)允许apt通过https使用repository安装软件包
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
3)添加Docker官方GPG key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4)验证key的指纹
sudo apt-key fingerprint 0EBFCD88
5)添加稳定版repository
国内阿里云版:
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"</