安装docker
yum update
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 推荐使用阿里源 比较快
yum install -y containerd.io
yum install -y docker-ce docker-ce-cli
docker -v
如果出现containerd.io的版本问题
wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
yum install -y containerd.io-1.2.6-3.3.el7.x86_64.rpm
yum install docker-ce docker-ce-cli
镜像加速
安装完以后配置镜像加速
/etc/docker/daemon.json
阿里云的方法
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
sudo systemctl daemon-reload
sudo systemctl restart docker