Docker错误:处理tar文件(退出状态1)时出错:意外的EOF
我需要空间并执行: docker rmi $(docker images -f dangling = true -q)
从那时起,我无法使用docker-compose: docker-compose build
,我收到错误: ERROR:处理tar文件时出错(退出状态1):意外的EOF
。
Since then I can't with docker-compose: docker-compose build
, I get the error: ERROR: Error processing tar file(exit status 1): unexpected EOF
.
我尝试删除所有映像,重新安装docker,但无济于事:总是相同的错误,一段时间后。
I tried to remove all images, reinstall docker, but nothing will do: always the same error, after quite some time.
我在另一个系统上构建并运行,这建议这是一个错误状态的问题。
I built on another system and it worked, which suggests that this is a wrong-state issue.
知道我应该清洗什么吗?
Any idea what I should clean?
使用:
▶ docker version
Client:
Version: 17.03.0-ce
API version: 1.24 (downgraded from 1.26)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 08:01:32 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24 (minimum version )
Go version: go1.6.2
Git commit: 78d1802
Built: Tue Jan 31 23:35:14 2017
OS/Arch: linux/amd64
Experimental: false
▶ docker-compose version
docker-compose version 1.11.2, build dfed245
docker-py version: 2.1.0
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.1t 3 May 2016
有一个内置命令可以删除未使用的图像(版本1.13 +):
There is an built in command to remove unused images (Version 1.13+):
docker image prune
现在可以处理这种情况:
Now to handle the situation:
-
停止Docker服务
Stop Docker Service
systemctl stop docker
备份 / var / lib / docker
然后:
删除 / var / lib / docker
警告:这将删除映像,容器,卷,请确保先备份。
Remove /var/lib/docker
Caution: This will remove images, containers, volumes, ... make sure you back it up first.
rm -rf /var/lib/docker
启动Docker服务
Start Docker service
systemctl start docker
更新:
如其他答案所述,在某些情况下可能是文件权限问题。请检查权限。
As noted in the other answer, In somecases it might be file permissions issue. Please review permissions.