sudo yum -y install yum-utils
sudo yum-config-manager \\ --add-repo \\ <https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo>
yum makecache fast(可能会报错,报错的话,用下面的) yum makecache (CentOS8没有fast参数,可以去掉)
yum install docker-ce docker-ce-cli containerd.io
systemctl enable docker(设置开机自启动) systemctl start docker
docker run hello-world
如果出现“Hello from Docker!”,则代表运行成功
docker version