Yum安装
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#如果国内报错试试
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#sudo yum-config-manager --enable docker-ce-edge
#sudo yum-config-manager --disable docker-ce-edge
#查看可使用的版本
yum list docker-ce --showduplicates | sort -r
#安装指定版本
sudo yum install docker-ce-<VERSION STRING>
#安装最新版本
sudo yum install docker-ce
#启动docker
sudo systemctl start docker
sudo systemctl enable docker
#Hello World
sudo docker run hello-world
下载安装
#下载地址:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
sudo yum install xxxxx.rpm
sudo systemctl start docker
sudo docker run hello-world