Removing docker images

docker rmi image_id_1 image_id_2 image_id_3

If you want to remove the dangling images, you can use the prune option:

docker image prune
If you want to remove both unused and dangling images at once, you can use prune with option -a:

docker image prune -a

To remove all docker images, you need to first stop all the running containers.

docker ps -a -q | xargs docker rm
Now you can delete all the images this way:

docker images -a -q | xargs docker rmi -f

Comments