Install Docker on Centos7

  1. 升级系统内核 https://icbd.github.io/wiki/linux/2018/12/09/centos7-update-kernel.html

  2. 安装依赖

yum install -y yum-utils device-mapper-persistent-data lvm2
  1. 添加 docker-ce 源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  1. 替换加速镜像(可选)
sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
  1. 安装
yum install docker-ce
  1. 设置开机启动并启动
systemctl enable docker
systemctl start docker
  1. 测试hello-world
docker info
docker run hello-world