Docker Tip #4 - Scrub dangling containers

When running Docker you pull down images. Those images can take up quite a bit of space. After tagging / retagging / untagging you can end up with dangling containers. So a bit of house keeping needs to be done.

The following command line will get rid of the so-called dangling containers:

    docker mi $(docker images -q -f "dangling=true")

For bash users the following alias will come in handy

    alias docker-scrub='docker mi $(docker images -q -f "dangling=true")'


Posted August 24, 2016