官方文档:`https://docs.docker.com/engine/install/centos/`
1. 确定是 `CentOS7` 及以上版本
2. 卸载旧版本
```shell
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
```
3. `yum` 安装 `gcc` 相关
```shell
yum -y install gcc
yum -y install gcc-c++
```
4. 安装需要的软件包
```shell
yum install -y yum-utils
```
5. 设置 `stable` 镜像仓库
```shell
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
```
6. 更新 `yum` 软件包索引
```shell
yum makecache fast
```
7. 安装 `DOCKER CE`
```shell
yum -y install docker-ce docker-ce-cli containerd.io
```
8. 启动 `docker`
```shell
systemctl start docker
```
9. 测试
```shell
docker version
```