centos7 Quick Install yum source and docker
Use su command to get super administrator privileges
su
Configuring the DNS under centos
vi /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
The original source in backup yum
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo_bak
Optionally one of the following sources yum
网易yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all
yum makecache
阿里云yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
epel源
yum -y install epel-release
yum clean all
yum makecache
Installation docker
By uname -r command to see your current kernel version must be higher than 3.10
uname -r
Ensure that the yum package up to date
sudo yum update
Uninstall the old version (if an old version installed)
sudo yum remove docker docker-common docker-selinux docker-engine
Required installation package, yum-util provide yum-config-manager function, the other two are driven dependent devicemapper
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Set yum source
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
You can view all versions of all warehouse docker, and select a specific version is installed
yum list docker-ce --showduplicates | sort -r
Installation docker (by default because the repo open only stable warehouse, so here to install the latest stable version)
sudo yum install docker-ce
Start and join the boot
sudo systemctl start docker
sudo systemctl enable docker
Verify that the installation was successful (there are two parts, client service and installation start indicate docker had been successful)
docker version