Docker commands to clean unused images

If you use docker for some time, there will be a lot of trash images, volumes that is not used by any containers. Here’s how to remove them. (warning: not reversible)

Remove dangling images

Remove dangling volumes

As seen from above commands, you may guess the nested command within the $(…) is used to list dangling images/volumes

List dangling images

List dangling volumes

Share your thoughts