在安装docker以前,建议加上国内apt 镜像资源, 好比清华、中科院的国内镜像资源linux
1. 更新apt安装包索引docker
sudo apt-get update
2. 安装ubuntu
3.添加官方Gpg keysudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
4.更新apt索引
sudo apt-get update
5. 开始安装docker ce社区版
sudo apt-get install docker-ce
6. 验证是否安装成功
sudo docker run hello-world