注: docker官网有详细的安装文档:
https://docs.docker.com/engine/install/centos/
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
sudo yum install -y yum-utils
sudo yum-config-manager \ --add-repo \ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
docker-ce中的ce是社区版的意思,ee企业版。我们安装的是社区版。
sudo yum install docker-ce docker-ce-cli containerd.io
systemctl start docker
docker version
docker run hello-world
docker images
sudo yum remove docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/containerd