官方文档:链接地址
1. SET UP THE REPOSITORY(设置yum仓库)
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
2. Install the latest version of Docker CE
$ sudo yum install docker-ce docker-ce-cli containerd.io
3. Start Docker
$ sudo systemctl start docker
4. 开机自动启动
$ sudo systemctl enable docker
5. Uninstall Docker CE
$ sudo yum remove docker-ce