Header Ads

Docker remove all container, images, volumes, network

Docker remove all container, images, volumes, networking


Docker remove all container, images, volumes, networking



The docker system prune command will remove all stopped containers, all dangling images, and all unused networks:

docker system prune

If you also want to remove all unused volumes, pass the --volumes flag:

docker system prune --volumes

Docker remove all container

List all container in docker:


docker container ls -a

Remove all container in docker


docker rm <container_id1> <container_id2>

OR work on Linux, Mac, on Windows use must use ConEmu 

Stop all container and remove all container

docker stop $(docker container ls -a -q)

docker rm $(docker container ls -a -q)


Docker remove all container stopped


docker container prune


For example to remove all images that are created more than 12 hours ago, run:


docker container prune --filter "until=12h"


Docker remove all images


Docker list all images


docker images -a

Docker remove images don't link with container, another images


docker rmi <iamge_id1> <image_id2>

Or use in Linux, Mac


docker rmi $(docker images -a -q)

Remove all unused images


docker image prune

Remove all images not link with container, another container


docker image prune -a

For example to remove all images that are created more than 12 hours ago, run:

docker image prune -a --filter "until=12h"


Docker remove all volumes


List once volumes in docker


docker volume ls

Docker remove volumes


docker volume rm <local>


Remove all unused volume

docker volume prune


Docker remove all network


Docker remove once network


List all network in docker


docker network ls

Remove network


docker network rm <network_id>


Docker remove all unused network


docker network prune

Docker remove network with filter


docker network prune -a --filter "until=12h"



No comments