Skip to content

Cleanup

Images, stopped containers, volumes and build cache pile up quickly.

Terminal window
docker system df # summary by type
docker system df -v # detail per image, container and volume

With Podman, run it as the same user that created the containers: rootless and root (sudo podman) have separate storage.

Terminal window
docker container prune # stopped containers
docker image prune # dangling images
docker image prune -a # all images not used by any container
docker volume prune # unused volumes (data is lost!)
docker builder prune # build cache (Docker)
docker system prune # stopped containers, unused networks, dangling images and build cache
docker system prune -a --volumes # everything unused, volumes included (careful)

Every prune asks for confirmation; add -f to skip it in scripts.

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.