Cleanup
Images, stopped containers, volumes and build cache pile up quickly.
How much space is used
Section titled “How much space is used”docker system df # summary by typedocker system df -v # detail per image, container and volumeWith Podman, run it as the same user that created the containers: rootless and root (sudo podman) have separate storage.
Free space
Section titled “Free space”docker container prune # stopped containersdocker image prune # dangling imagesdocker image prune -a # all images not used by any containerdocker volume prune # unused volumes (data is lost!)docker builder prune # build cache (Docker)docker system prune # stopped containers, unused networks, dangling images and build cachedocker system prune -a --volumes # everything unused, volumes included (careful)Every prune asks for confirmation; add -f to skip it in scripts.
Where it lives on disk
Section titled “Where it lives on disk”| Tool | Default location |
|---|---|
| Docker | /var/lib/docker |
| Podman (root) | /var/lib/containers/storage |
| Podman (rootless) | ~/.local/share/containers/storage |
If the disk fills up, check those folders with the commands from Disk usage.