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

Solution 1:

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

Solution 2:

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.

Solution 3:

For me it was a permission error. I walked against the same exact issue as PR, ERROR: Error processing tar file(exit status 1): unexpected EOF My solution is dirty but worked for me

chown -R 777 /foo/bar/project

You almost always want to avoid to set permissions on 777, 655 is more reasonable.

0 = ---
1 = --x
2 = -w-
3 = -wx
4 = r-
5 = r-x
6 = rw-
7 = rwx

A more detailed explanation can be found here: https://www.pluralsight.com/blog/it-ops/linux-file-permissions