Cleanup disk space occupied by Docker images

后端 未结 3 1831
执笔经年
执笔经年 2021-02-07 04:54

I am running docker on windows 10.

I had a couple of images stored in my machine. The total size of these images accumulated to around ~10GB. I have deleted these images

3条回答
  •  后悔当初
    2021-02-07 05:29

    Update Q4 2016: as I mention in "How to remove old and unused Docker images", use:

    docker image prune -a
    

    (more precise than docker system prune)

    It will remove dangling and unused images. Warning: 'unused' means "images not referenced by any container": be careful before using -a.

    Then check if the disk space for images has shrunk accordingly.


    Original answer:

    See the Medium article "How to clean up Docker (~5GB junk!)" from katopz.

    It refers to the docker-cleanup script, for removing old exited process, and dangling images.
    I have my own aliases as well.

    But it also mentions that, since docker 1.10, you now have named volumes that need to be removed as well:

    docker volume rm $(docker volume ls -qf dangling=true)
    

提交回复
热议问题