Docker ERROR: Error processing tar file(exit status 1): unexpected EOF

匿名 (未验证) 提交于 2019-12-03 02:56:01

问题:

I needed space and executed: docker rmi $(docker images -f "dangling=true" -q)

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.

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?

Using:

回答1:

There is an built in command to remove unused images (Version 1.13+):

docker image prune 

Now to handle the situation:

  • Stop Docker Service

    systemctl stop docker 
  • Backup /var/lib/docker then:

  • Remove /var/lib/docker Caution: This will remove images, containers, volumes, ... make sure you back it up first.

    rm -rf /var/lib/docker 
  • Start Docker service

    systemctl start docker   

Update:

As noted in the other answer, In somecases it might be file permissions issue. Please review permissions.



回答2:

I had the same issue and the approved answer didn't work for me.

Turns out I had a file with permissions which didn't allow the user running docker-compose to read it. After removing the file everything was OK



回答3:

For me the issue turned out that a Docker Pull was hung, so I CTRL+C'd out of it and tried again. Same error message.

In the end I found some files owned by root in this directory. Giving the files proper permissions fixed the issue.

chown -R <username>:<group> /var/lib/docker/tmp

  • MAC Docker version 17.12.0-ce, build c97c6d6


回答4:

If you have tried looking through permissions, docker reset, docker system prune, deleting all containers, deleting all images (dangling or otherwise), reading about everything that there is surrounding this issue and have had no success. Try uninstalling docker and re-installing the stable version.

Although, the error I was struggling with was : Error processing tar file(exit status 1): mkdir /some/path/name: no such file or directory



回答5:

Try increasing the memory for Docker, it fixed the issue for me.

Docker memory setting in Preferences was set to 2GB, so when pulling the ~3GB image, I was getting exactly this error:

$ docker pull skymindops/skil-ce latest: Pulling from skymindops/skil-ce 118c5f2883d6: Pull complete  3d199b2e6224: Extracting [==================================================>]  2.902GB/2.902GB failed to register layer: Error processing tar file(exit status 1): unexpected EOF 

Increasing the memory limit fixed it (I also increased the swap, but unsure was it required or not).



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!