“no space left on device” even after removing all containers

后端 未结 3 1416
我在风中等你
我在风中等你 2021-02-05 15:26

While experimenting with Docker and Docker Compose I suddenly ran into \"no space left on device\" errors. I\'ve tried to remove everything using methods suggested in similar qu

3条回答
  •  半阙折子戏
    2021-02-05 16:09

    The problem is that /var/lib/docker is on the / filesystem, which is running out of inodes. You can check this by running df -i /var/lib/docker

    Since /home's filesystem has sufficient inodes and disk space, moving Docker's working directory there there should get it going again.

    (Note that the this assumes there is nothing valuable in the current Docker install.)

    First stop the Docker daemon. On Ubuntu, run

    sudo service docker stop
    

    Then move the old /var/lib/docker out of the way:

    sudo mv /var/lib/docker /var/lib/docker~
    

    Now create a directory on /home:

    sudo mkdir /home/docker
    

    and set the required permissions:

    sudo chmod 0711 /home/docker
    

    Link the /var/lib/docker directory to the new working directory:

    sudo ln -s /home/docker /var/lib/docker
    

    Then restart the Docker daemon:

    sudo service docker start
    

    Then it should work again.

提交回复
热议问题