sudo yum install -y yum-utils device-mapper-persistent-data lvm2
installs the required packages
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
setup stable repository
sudo yum install docker-ce
Install the latest version of Docker CE (Community Edition)
Press Y twice to confirm
sudo systemctl start docker
启动Docker
sudo docker run hello-world
Verify that the installation is correct by running the hello-world image
docker versionView
docker version