In this guide, I will show you simple tips to stop and remove containers, docker images, and values.
List all Docker Images
1 |
docker images -q |
Removing Docker Image or images
1 2 3 4 |
// to remove one specific image docker rm image1 // to remove two (more) specific images, just mention list docker rm image1 image2 |
Removing All Docker Image
1 |
docker rmi $(docker images -q) |
Remove a container(s)
1 2 3 4 |
// to remove one specific container docker rm container1 // to remove two (more) specific container, just mention list docker rm container1 container2 |
Remove a container and its volume
1 |
docker rm -v container_name |
List all containers (only IDs)
1 |
docker ps -aq |
Stop all running containers
1 |
docker stop $(docker ps -aq) |
Remove all containers
1 |
docker rm $(docker ps -aq) |
Remove all exited containers
1 |
docker rm $(docker ps -a -f status=exited -q) |
Remove containers using more than one filter
1 |
docker rm $(docker ps -a -f status=exited -f status=created -q) |
clean all in one command
1 |
docker system prune |
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.
Subscribe
Login
0 Comments