1.环境检查(kernel内核是否在3.10以上)
uname -a
2.检查device mapper
sudo grep device-mapper /proc/devices
3.https支持 和 CA证书
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
4.卸载旧版本
sudo apt-get remove docker docker-engine docker-ce docker.io
5.添加gpg密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
6.设置存储库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
7.更新apt
sudo apt-get update
8.查看安装对应版本
apt-cache madison docker-ce
sudo apt-get install -y docker-ce=版本号 //指定版本安装
sudo apt-get install -y docker-ce //最新版安装