需要先安装依赖,不然安装不成功

  • 添加repo

    curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
  • 安装依赖

wget https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm

yum install -y containerd.io-1.2.6-xxx.rpm
  • 安装docker
    dnf install docker-ce

  • 设置开启启动
    systemctl enable docker
    systemctl start docker

参考:https://blog.51cto.com/13760351/2468406