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

前端 未结 13 2166
离开以前
离开以前 2020-12-14 06:12

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

Since then I can\'t with docker-compose: docker-compose build

相关标签:
13条回答
  • 2020-12-14 06:15

    there could be several different problems. You can find out the problem by checking the issue that docker build is throwing.

    The problem is that docker-compose build will suppress the information of the issue. To find out what the issue is

    do not use:

    docker-compose build XXX
    

    instead, open your docker-compose.yml, find the build: tag of the service is giving you an issue, e.g.

    services:
       yourservice: 
           build: yourservice-directory/
    

    and then run:

    docker build yourservice-directory
    

    after this you will see what is the issue.

    0 讨论(0)
  • 2020-12-14 06:16

    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

    0 讨论(0)
  • 2020-12-14 06:24

    Reference: https://medium.com/the-code-review/clean-out-your-docker-images-containers-and-volumes-with-single-commands-b8e38253c271

    1. Clean up containers, images, volumes and networks on your system:
    docker system prune --all --force --volumes
    2. docker-compose up

    0 讨论(0)
  • 2020-12-14 06:24

    I found a temporary solution:

    1. Ensure specify the image name on docker-compose.yml for example, specify the image name and container_name as django_practice_db/django_practice_web

      services:
        django_practice_db:
          image: postgres
          container_name: django_practice_db
        django_practice_web:
          container_name: django_practice_web
          build: .
          command: pipenv run python manage.py runserver 0.0.0.0:8000
      
    2. Copy the project file to another place

    3. Go inside the copied project directory

    4. Execute docker-compose build

    5. Go back to the original project directory

    6. Execute docker-compose up

    Not sure why I can build images when I change the folder path.

    0 讨论(0)
  • 2020-12-14 06:27

    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
    0 讨论(0)
  • 2020-12-14 06:30

    I tried everything from rebooting, reinstalling Docker, and purging /var/lib/docker.

    My cause was something corrupting the build context in my project. After I ran git clean to reset the project directory back to its original state, I was able to docker-compose.

    Run git clean -iXd in your project's root to interactively git clean.

    Edit: after a while, it happened again. This time, git clean didn't fix it. I'm pretty sure it only happens on Ubuntu. My arch coworkers have never encountered it.

    0 讨论(0)
提交回复
热议问题