How to delete Docker images on a Mac

3 MIN READ · UPDATED
SHORT ANSWER
docker system prune -a

Removes stopped containers, unused networks, build cache and every image no container uses. Volumes, where databases keep their data, stay unless you add --volumes.

1. See what’s using space

Shows how much images, containers, volumes and build cache take up, and how much of it Docker can reclaim.

docker system df

2. Remove what nothing uses

Docker lists what it will delete and asks first. Leave out -a to remove only dangling images, the untagged layers left over from rebuilds.

docker system prune -a

3. Or remove a single image

docker image ls
docker rmi node:18

4. Check your Mac got the space back

Docker Desktop keeps everything in one disk image, Docker.raw. Finder shows its maximum size, not what it really uses. The first number here is the real size, and it drops within seconds of deleting images.

ls -klsh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

With Colima or OrbStack, the docker commands are the same.

Is it safe?

Images you remove download again on the next pull or build. Stopped containers are deleted, along with anything they wrote outside a volume. Volumes stay unless you pass --volumes, so run docker volume ls first if you’re unsure.