ubuntu系统安装docker详细教程
1.卸载旧版本docker
sudo apt-get remove docker docker-engine docker-ce docker.io
更新apt包索引
sudo apt-get update
2.安装apt依赖包,用于通过HTTPS来获取仓库
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
3.添加 Docker 的官方 GPG 密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.设置stable存储库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
更新apt包索引
sudo apt-get update
5.安装新版本Docker CE
sudo apt-get install -y docker-ce
6.查看docker服务是否启动
systemctl status docker

启动docker服务
sudo systemctl start docker
加入开机自动启动
sudo systemctl enable docker
7.验证docker
sudo docker run hello-world
