我正在从 docker hub 拉取一个 docker 镜像。但它说明了一个错误。它说找不到“AddResource”方法:
docker: error adding content digest to lease: sha256:31168c113862cce4cef6b16b20cdef1b126eb755492a6030ca68a9020b7eb657: unknown method AddResource: not implemented.
我尝试了几次,并尝试提取不同的图像。错误是一样的。 docker 版本为:
Client: Docker Engine - Community
Version: 20.10.1
API version: 1.41
Go version: go1.13.15
Git commit: 831ebea
Built: Tue Dec 15 04:34:59 2020
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.1
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: f001486
Built: Tue Dec 15 04:32:40 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.4
GitCommit: e6b3f5632f50dbc4e9cb6288d911bf4f5e95b18e
runc:
Version: 1.2.4
GitCommit: 6635b4f0c6af3810594d2770f662f34ddc15b40d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
答案 0 :(得分:1)
对我来说,结果是由于 containerd 中的一个错误,我有一段时间没有更新它。所以使用
更新containerdsudo pacman -Sy containerd
并重新启动两个服务
sudo systemctl restart containerd.service
sudo systemctl restart docker
解决了这个问题。现在我有:
docker version Client: Version: 20.10.1 API version: 1.41 Go version: go1.15.6 Git commit: 831ebeae96 Built: Tue Dec 15 22:25:01 2020 OS/Arch: linux/amd64 Context: default Experimental: true Server: Engine: Version: 20.10.1 API version: 1.41 (minimum version 1.12) Go version: go1.15.6 Git commit: f0014860c1 Built: Tue Dec 15 22:24:28 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.4.3 GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b.m runc: Version: 1.0.0-rc92 GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff docker-init: Version: 0.19.0 GitCommit: de40ad0
问题已解决
答案 1 :(得分:0)
当 docker-client
版本和 docker-server
版本不匹配时,我看到了此错误。在您的情况下,它们似乎相同,但是,如果您使用的是 ubuntu perform,我建议您重新安装它们:
sudo apt-get remove docker-ce
sudo apt-get remove docker-ce-cli
sudo apt-get install docker-ce-cli=5:20.10.1~3-0~ubuntu-$(lsb_release -cs) --assume-yes
sudo apt-get install docker-ce=5:20.10.1~3-0~ubuntu-$(lsb_release -cs) --assume-yes
注意:我有一个更新的容器D:
docker version
Client: Docker Engine - Community
Version: 20.10.1
API version: 1.41
Go version: go1.13.15
Git commit: 831ebea
Built: Tue Dec 15 04:34:59 2020
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.1
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: f001486
Built: Tue Dec 15 04:32:40 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
答案 2 :(得分:0)
我在arm机上拉镜像时遇到同样的问题,用楼上的解决方法重装docker后拉镜像成功。
sudo systemctl stop docker
sudo dpkg -r docker.io
sudo dpkg -i (containerd, docker-ce-cli, docker-ce that have the same version)