```
yum install -y yum-utils device-mapper-persistent-data lvm2
yum makecache fast
```
```
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
```
yum install docker-ce -y
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://c****.mirror.aliyuncs.com"]
}
EOF
# 镜像加速用自己的阿里云地址吧
```
```
systemctl daemon-reload
systemctl restart docker
```
```
docker version
# 查看版本
```
# 可加可不加
上面做了镜像加速
```
vi /etc/docker/daemon.json
# 镜像加速配了 加国内镜像仓库也行
{
"registry-mirrors": ["https://c*****.mirror.aliyuncs.com","https://hub-mirror.c.163.com"]
}
****前面的为阿里云镜像加速服务的地址
```
```
systemctl restart docker
systemctl restart docker
docker pull centos
docker images
```