# 更新yum
yum -y update
# 安装所需的软件包。yum-utils提供了yum-config-manager 效用,device-mapper-persistent-data和lvm2 需要 devicemapper存储驱动程序
yum install -y yum-utils device-mapper-persistent-data lvm2
# 使用以下命令来设置稳定的存储库。
#也可以使用阿里的http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 列出 docker-ce 的版本
yum list docker-ce --showduplicates | sort -r
# 安装特定版本的 Docker Engine-Community
yum -y install docker-ce-18.09.1 docker-ce-cli-18.09.1 containerd.io
# 启动 docker
systemctl start docker
# 通过运行hello-world 映像来验证是否正确安装了Docker Engine-Community 。
docker run hello-world
Centos7.5 安装 Docker
于 2019-12-12 10:51:32 首次发布