Docker remove all images despite containers using them
docker rmi -f $(docker images -q)
Remove all containers:
docker rm $(docker ps -a -q)
Remove all images without name:
docker rmi $(docker images | grep '^<none>' | awk '{ print $3 }')
Forced removal (even if some container is using it):
docker rmi -f $(docker images | grep '^<none>' | awk '{ print $3 }')
Written by Misha Behersky
Related protips
1 Response
Try docker rmi $(docker images -f "dangling=true" -q)
to remove unnamed images
over 1 year ago
·
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#