Here I am going to write about removing docker images, volumes and containers. To do so, first of all, you need to shutdown the docker container.
docker-compose down
After that, you can follow following method to remove required things,
# To remove all the containers
docker rm -f $(docker ps -a -q)
# To remove all the docker images
docker rmi -f $(docker images -a -q)
# To remove all the volumes
docker volume rm $(docker volume ls -q)
# To delete everything
docker system prune -a --volumes
Top comments (1)
Cool trick :)