centos安装docker
linux安装docker
1、线卸载旧版本Docker
yum remove docker docker-common docker-selinux docker-engine
2、安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
3、添加docker yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.安装docker
yum -y install docker-ce
如果报错改为5的方式:
报错内容Delta RPMs disabled because /usr/bin/applydeltarpm not installed
解决方案
sudo yum provides '*/applydeltarpm'
sudo yum install deltarpm
5.重新安装(如果4错误)
wget http://mirrors.aliyun.com/docker-engine/yum/repo/main/centos/7/Packages/docker-engine-17.03.0.ce-1.el7.centos.x86_64.rpm]
手动安装
yum install docker-engine-17.03.0.ce-1.el7.centos.x86_64.rpm
6、启动Docker
systemctl start docker
7、测试Docker
docker run hello-world