#安装依赖包:
yum install -y yum-utils
#添加 yum
软件源:
yum-config-manager
--add-repo
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's/download.docker.com/mirrors.aliyun.com/docker-ce/g' /etc/yum.repos.d/docker-ce.repo
#更新
yum
软件源缓存,并安装 docker-ce
。yum install docker-ce docker-ce-cli containerd.io
#启动docker与开机启动
systemctl restart docker
systemctl enable docker
#测试是否成功
docker info