yum安装最新版docker

yum安装依赖包

yum -y instll yum-utils device-mapper-persistent-data lvm2

获取下载20.x版本docker源

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum安装docker-ce

yum -y install docker-ce

启动docker

systemctl start docker
systemctl status docker

查看dockers版本

docker --version
Docker version 20.10.7, build f0df350

下载并启动hello-world查看是否成功

docker run hello-world

latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:5122f6204b6a3596e048758cabba3c46b1c937a46b5be6225b835d091b90e46c
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
原文地址:https://www.cnblogs.com/cfy930721/p/14850508.html