Introduction
this is part 20 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.
And I will cover lot of tools as we move on.
Cleaning
Let's see how many stopped containers we have by using
docker ps -a
We have a lot!
what about images?
docker image ls
we see a lot of basically those none are failed building images and they are not being used by anything , they called dangling images.
to see how much docker using space we run
docker system df
we can see it's taking 6.1GB lot of space
let's clean all images that are not used by containers and dangling , we run
docker system prune
some useful tags here :
-f used to force , so we don't get a prompt to delete (good for automation tools)
-a used to delete every things including used images.
docker system prune -f
we see it delete lot of things , cool!
docker ps -a
docker image ls
as we see we have no containers anymore all stopped
and all our images gone!
if you need only to stop containers .
docker container stop $(docker container ls -a -q)
Top comments (0)