Skip to content

Docker – Remove/Delete images

The docker system prune command removes all stopped containers, dangling images, and unused networks. If you pass the --volumes flag, it will remove all unused volumes too.

You can execute the below commands in the terminal to remove all the images and docker containers as described above.

docker system prune
docker system prune --volumes

You can also use docker image rm command to remove one or more images.

Syntax

docker image rm [OPTIONS] IMAGE [IMAGE...]

OPTIONS:
--force , -f Force removal of the image 
--no-prune Do not delete untagged parents

Comments are closed, but trackbacks and pingbacks are open.