docker ubuntu安装

在安装docker之前,建议加上国内apt 镜像资源, 比如清华、中科院的国内镜像资源

1. 更新apt安装包索引

sudo apt-get update

2. 安装

sudo apt-get install 
    apt-transport-https 
    ca-certificates 
    curl 
    software-properties-common


3.添加官方Gpg key
 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
 
 
原文地址:https://www.cnblogs.com/energy1010/p/9380855.html