简体   繁体   English

拉取失败后无法连接到 Docker 守护进程

[英]Cannot connect to the Docker daemon after failed pull

When I try to pull a certain docker image, my pull fails, and then prevents me from connecting to the docker deamon again until I reboot my laptop.当我尝试拉取某个 docker 镜像时,我的拉取失败,然后阻止我再次连接到 docker 守护进程,直到我重新启动我的笔记本电脑。 The Image in question is an official Jupyter images which works fine on my other machine.有问题的图像是官方的 Jupyter 图像,在我的另一台机器上运行良好。 Restarting the Deamon does not help, but rebooting my laptop does.重新启动守护进程没有帮助,但重新启动我的笔记本电脑有帮助。

I tried to docker system prune -a already, that's why there are no images on my laptop anymore.我已经尝试docker system prune -a ,这就是为什么我的笔记本电脑上不再有图像的原因。 Does somebody have an idea how to fix this problem?有人知道如何解决这个问题吗?

I think the problem might be connected to one of the images not finishing it's extraction.我认为问题可能与未完成提取的图像之一有关。

EDIT编辑

I have the same problem with a alpine image.我对高山图像有同样的问题。 see below见下文

me@mylaptop $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

me@mylaptop $ docker pull jupyter/datascience-notebook
Using default tag: latest
latest: Pulling from jupyter/datascience-notebook
e6ca3592b144: Extracting [==================================================>]  28.56MB/28.56MB
534a5505201d: Download complete 
990916bd23bb: Download complete 
979cd14ae800: Download complete 
5e8b9f8fa9e0: Download complete 
6f224ed88dc4: Download complete 
6ee9ec4a62a8: Download complete 
7a1ae22ba760: Download complete 
a1602338a8d7: Download complete 
fce5135a7ea1: Download complete 
e62a1c9017ef: Download complete 
a5049ad1c512: Download complete 
ec06c1612b0a: Download complete 
acceda87b341: Download complete 
939052532b6f: Download complete 
d2dee4cc07fe: Download complete 
4fe5e9dd4fad: Download complete 
8fd08517e0c6: Download complete 
7105a3ca8c38: Download complete 
66c0798f609e: Download complete 
94f3fc35ed38: Download complete 
aa68263474a3: Download complete 
6e7d1433394b: Download complete 
f5902e69d9b7: Download complete 
490bb991b4de: Download complete 
fab6e92b04fa: Download complete 
failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root297865553: device or resource busy

me@mylaptop $ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
me@mylaptop $ sudo systemctl start docker

me@mylaptop $ systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2020-09-30 08:11:12 CEST; 15min ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 908 (dockerd)
      Tasks: 10
     Memory: 140.8M
     CGroup: /system.slice/docker.service
             └─908 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992016198+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992433459+02:00" level=info msg="Loading containers: start."
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.227615723+02:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can b>
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.296603004+02:00" level=info msg="Loading containers: done."
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.486944893+02:00" level=warning msg="Not using native diff for overlay2, this may cause degraded performance for building images: >
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.487273874+02:00" level=info msg="Docker daemon" commit=48a66213fe graphdriver(s)=overlay2 version=19.03.12-ce
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.491959213+02:00" level=info msg="Daemon has completed initialization"
sep 30 08:11:12 mylaptop dockerd[908]: time="2020-09-30T08:11:12.530816090+02:00" level=info msg="API listen on /run/docker.sock"
sep 30 08:11:12 mylaptop systemd[1]: Started Docker Application Container Engine.
sep 30 08:23:36 mylaptop dockerd[908]: time="2020-09-30T08:23:36.941202710+02:00" level=info msg="Attempting next endpoint for pull after error: failed to register layer: Error processing tar fi>

me@mylaptop $ docker images
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

me@mylaptop $ docker pull alpine:3.12.0
3.12.0: Pulling from library/alpine
df20fa9351a1: Extracting [==================================================>]  2.798MB/2.798MB
failed to register layer: Error processing tar file(exit status 1): Error cleaning up after pivot: remove /.pivot_root517304538: device or resource busy

Solved it.解决了。 The problem is that my kernel was/became to old.问题是我的内核已经/变旧了。

The warning below by systemctl brought made me find this post on forums.docker.com systemctl 带来的以下警告让我在forums.docker.com上找到了这篇文章

me@mylaptop $ systemctl status docker
...
sep 30 08:11:11 mylaptop dockerd[908]: time="2020-09-30T08:11:11.992016198+02:00" level=warning msg="Your kernel does not support cgroup rt runtime"
...

I'm running Manjaro so I upgrade my kernel with this command:我正在运行 Manjaro,所以我使用以下命令升级我的内核:

sudo mhwd-kernel -i linux54

After which docker worked again.之后docker再次工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM