step1 #更新apt-get
apt-transport-https
step2 # 安装可几个包让apt可以通过https使用仓库
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
step3 # 添加docker官网GPG秘钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
step4 # 添加稳定的远程仓库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
step5 # 更新apt-get
apt-transport-https
step6 # 安装docker
sudo apt-get install docker-ce
step7 # 测试安装是否成功
sudo docker run hello-world