# 程序安装-Centos下安装Docker **Published by:** [web3_it](https://paragraph.com/@web3-it/) **Published on:** 2022-05-19 **URL:** https://paragraph.com/@web3-it/centos-docker ## Content 更新linuxsudo yum update 安装需要的软件包 yum-util 提供yum-config-manager功能,另两个是devicemapper驱动依赖sudo yum install -y yum-utils device-mapper-persistent-data lvm2 设置yum源 中央仓库sudo yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo 阿里仓库sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 查看可用版本sudo yum list docker-ce --showduplicates | sort -r 安装 选择一个版本并安装,yum install docker-ce-版本号sudo yum -y install docker-ce-20.10.0-3.el7 docker-ce-cli-20.10.0-3.el7 containerd.io 设置开机启动sudo systemctl enable docker sudo systemctl start docker 验证是否安装成功 查看版本运行hello-worldsudo docker run --rm hello-world ## Publication Information - [web3_it](https://paragraph.com/@web3-it/): Publication homepage - [All Posts](https://paragraph.com/@web3-it/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@web3-it): Subscribe to updates