Docker remove old images and containers

By the time, old images and containers are still on the system and use a lot of disk space.

Show old containers and images

See the docker images with their ID:

docker images -a

See the stopped docker containers with their ID:

docker ps -a | grep Exit
docker ps -a -f status=exited

Remove single containers and images

Remove a container:


Remove an image:

docker rmi CONTAINERID

Force to remove an image if it is still referenced:

docker rmi -f CONTAINERID

A list of additional command options and other useful commands can be found here: