Docker [for mac]文件系统变为只读,这破坏了Docker的几乎所有功能 [英] Docker [for mac] file system became read-only which breaks almost all features of docker

查看:880
本文介绍了Docker [for mac]文件系统变为只读,这破坏了Docker的几乎所有功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Docker进入错误状态,无法再使用它.

My Docker ran into an error state, where I cannot use it anymore.

docker system info的输出:

Containers: 14
Running: 2
Paused: 0
Stopped: 12
Images: 61
Server Version: 18.03.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: error
NodeID:
Error: open /var/lib/docker/swarm/worker/tasks.db: read-only file system
Is Manager: false
Node Address: 192.168.65.3
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.87-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: MCSC:SFXH:R3JC:NU4D:OJ5V:K4B5:LPMJ:2BFL:LHT3:LYCI:XKY2:DTE6
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: docker.for.mac.http.internal:3128
HTTPS Proxy: docker.for.mac.http.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

在我构建了以下Dockerfile之后,发生了此行为:

This behaviour occured, after I built the following Dockerfile:

FROM perl:5.20

FROM perl:5.20

运行apt-get更新&& apt-get install -y libsoap-lite-perl \
&& rm -rf/var/lib/apt/lists/*

RUN apt-get update && apt-get install -y libsoap-lite-perl \
&& rm -rf /var/lib/apt/lists/*

运行cpan SOAP :: LITE

RUN cpan SOAP::LITE

当我尝试构建映像或运行容器或删除映像时,错误消息总是与此类似:

the error message when I try to build an image or run a container or remove an image is always similar to this:

Error: open /var/lib/docker/swarm/worker/tasks.db: read-only file system

例如,如果我尝试执行此命令:

for example if I try to execute this command:

docker container run -it perl:5.20 bash

我收到此错误:

docker: Error response from daemon: mkdir /var/lib/docker/overlay2/1b966e163e500a8c78a64e8d0f14984b091c1c5fe188a60b8bd030672d3138d9-init: read-only file system.

我该如何重置我的码头工人,以使这些错误消失?

How can I reset my docker so these errors go away?

推荐答案

转到右上角的docker for mac Icon,单击它,然后单击重新启动". 之后,Docker将按预期工作.

Go to your docker for mac Icon in the top right, click on it and then click Restart. After that Docker works as expected.

这似乎是一个临时性的问题,因为在重启docker之后我无法重现它.我的猜测是,当Docker尝试在Dockerfile中下载并安装软件包时,我发生了网络通信故障.

This seems to be an temporary issue since I cannot reproduce it after restarting docker. My guess is that I had an network communication breakdown while docker tried to download and install the packages in the Dockerfile.

这篇关于Docker [for mac]文件系统变为只读,这破坏了Docker的几乎所有功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆