今天在 CentOS 8 安裝 Docker-ce 出現 Containerd.io 的錯誤,查了一下資料發現是 Docker 在 CentOS 8 預設的 containerd.io 太低,需要上官方下載較新的版本,底下就開始解決問題吧!

使用 Yum 安裝 Docker-ce 時,出現了以下錯誤,回報的錯誤是 containerd.io 需要 1.2.2-3 版本以上。

sudo yum install docker-ce docker-ce-cli containerd.io
Last metadata expiration check: 0:43:28 ago on Thu 16 Apr 2020 11:36:42 AM UTC.
Error:
Problem: 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
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

使用 sudo yum info containerd.io 查看軟體資訊,發現預設的版本是 1.2.0 。

sudo yum info containerd.io
Last metadata expiration check: 0:56:58 ago on Thu 16 Apr 2020 11:36:42 AM UTC.
Available Packages
Name         : containerd.io
Version      : 1.2.0
Release      : 3.el7
Architecture : x86_64
Size         : 22 M
Source       : containerd.io-1.2.0-3.el7.src.rpm
Repository   : docker-ce-stable
Summary      : An industry-standard container runtime
URL          : https://containerd.io
License      : ASL 2.0
Description  : containerd is an industry-standard container runtime with an emphasis on
: simplicity, robustness and portability. It is available as a daemon for Linux
: and Windows, which can manage the complete container lifecycle of its host
: system: image transfer and storage, container execution and supervision,
: low-level storage and network attachments, etc.

問題解決

既然版本太低,就從 Docker 官網下載較新的版本來使用吧。

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

之後再重新安裝 Docker-ce ,就安裝完成了!

sudo yum -y install docker-ce docker-ce-cli

再來啟動 Docker 後,來試試看能不能使用

sudo systemctl start docker
docker run hello-world

參考文獻:https://docs.docker.com/engine/install/centos/

rHuei

一個喜歡亂玩亂弄的工程師。

Join the Conversation

2 Comments

Leave a comment

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *