docker system df # Show docker disk usage, including space reclaimable by pruning
docker container prune # Remove all stopped containers
docker volume prune # Remove all unused volumes
docker image prune # Remove unused images
docker system prune # All of the above, in this order: containers, volumes, images
docker system prune --all Remove all unused images not just dangling ones
docker system prune --force Do not prompt for confirmation
$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 21 6 7.111 GB 6.128 GB (86%)
Containers 6 6 4.324 MB 0 B (0%)
Local Volumes 2 2 227.3 MB 0 B (0%)
$ docker system prune
WARNING! This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
Are you sure you want to continue? [y/N] y
Deleted Containers:
b196859d0baa3f3049263d5817249950329c4ed039c20e354737bd772b49ac49
...
Deleted Volumes:
1f31a17634329611e36045cba5b4a50e073aeda133f2962c83679fe8f9268467
...
Deleted Images:
deleted: sha256:7c0b8fb7832b03f7a6347e72327b05e563c73e5d5a25a7f186ae8edf8a6b4b88
...
Total reclaimed space: 1.711 GB