Skip to content
Ben edited this page May 9, 2020 · 5 revisions

clean up docker images

docker images | grep "<none> <none>" | tr -s " " | cut -d' ' -f3 | xargs docker rmi

https://docs.docker.com/config/pruning/

on a Mac the files get stored in a QEMU image,

$ ls -hal /Users/ben/Library/Containers/com.docker.docker/Data//vms/0/Docker.qcow2
-rw-r--r--@ 1 username  staff    57G May  9 08:42 /Users/ben/Library/Containers/com.docker.docker/Data//vms/0/Docker.qcow2

For an overview of where disk space is being used,

$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              45                  17                  34GB                21.62GB (63%)
Containers          621                 0                   8.129GB             8.129GB (100%)
Local Volumes       5                   3                   251.1kB             20.79kB (8%)
Build Cache         0                   0                   0B                  0B

For an explanation of RECLAIMABLE, see https://stackoverflow.com/a/51520627/1164295

Clone this wiki locally