## CentOS安装Docker
### 卸载Docker
```shell script
yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
```
### 安装依赖包
```shell script
yum install -y yum-utils
yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
```
### 安装docker引擎
```shell script
yum install docker-ce docker-ce-cli containerd.io
启动docker
systemctl start docker
docker -v
docker images : docker镜像
docker开机自启动
systemctl enable docker
```
### docker镜像加速
```shell script
https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
1. 安装/升级Docker客户端
推荐安装1.10.0以上版本的Docker客户端,参考文档 docker-ce
2. 配置镜像加速器
针对Docker客户端版本大于 1.10.0 的用户
您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://mcmje5nr.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
```