Skip to content

Docker: Remove all images

I’ve been using Docker a lot at work for development. This leads to a pile-up of images on the server. In order to clear them out I made this handy little script.

!#/usr/bin/bash
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -q)

This will remove all images even attached ones on your system. Be aware that running this on production or a shared development environment will result in tears and loss of joy.

Published inDockerFull StackLinux

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *