Remove all docker images and containers
Problem: You use Docker, but working with it created lots of images and containers. You want to remove all of them to save disk space.
Solution: Warning: This will destroy all your images and containers. It will not be possible to restore them!
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
This solution has be proposed by GitHub user @crosbymichael in this issue
Written by Daniel STANCU
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Docker
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#