centos8.1安装docker

安装依赖

 yum install -y yum-utils  device-mapper-persistent-data  lvm2

 yum-config-manager  --add-repo   https://download.docker.com/linux/centos/docker-ce.repo

yum install docker-ce docker-ce-cli containerd.io

可能会提示以下错误:

==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》

错误:

问题: package docker-ce-3:19.03.8-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed

  - cannot install the best candidate for the job

  - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded

  - package containerd.io-1.2.13-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded

  - package containerd.io-1.2.2-3.el7.x86_64 is excluded

  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded

  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded

(尝试添加 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用最佳选择的软件包)

==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》==》

安装新版本containerd.io

dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

再装剩下两个

 yum install docker-ce docker-ce-cli

启动docker

systemctl start docker

查看版本

docker --version

开机自启

systemctl enable docker

你可能感兴趣的:(centos8.1安装docker)