1.卸载历史docker
sudo apt-get remove docker docker-engine docker.io
2. 更新apt-get源
sudo apt-get update
3.安装软件包让apt支持HTTPS
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
4.添加docker官方GPG KEY
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")/gpg | sudo apt-key add -
5.指纹验证
sudo apt-key fingerprint 0EBFCD88
是否是:9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
6.添加apt镜像仓库
x86_64:
sudo add-apt-repository\"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")\$(lsb_release -cs)\stable"
armhf:
echo"deb [arch=armhf] https://download.docker.com/linux/$(. /etc/os-release;echo"$ID")\$(lsb_release -cs)stable"|\sudo tee /etc/apt/sources.list.d/docker.list
7.安装docker CE(Docker 从 17.03版本之后分为 CE(Community Edition) 和 EE(Enterprise Edition))
sudo apt-get update
sudo apt-get install docker-ce
网友评论