Skip to content

Instantly share code, notes, and snippets.

@mannykary
Created November 1, 2020 19:25
Show Gist options
  • Save mannykary/228fa4b6c37b2dcfd44e9d4fd6a1809b to your computer and use it in GitHub Desktop.
Save mannykary/228fa4b6c37b2dcfd44e9d4fd6a1809b to your computer and use it in GitHub Desktop.
Useful Docker Commands

Useful Docker commands

NOTE: this is a WIP; I will add more to this document.

Remove all dangling anonymous volumes

This removes all dangling anonymous volumes. They can take up a lot of space over a long period of time, and should be cleaned out periodically.

Since anonymous valumes are unnamed, they have a 64 character hex string, so we can use grep to filter only for 64-character long volume names.

docker volume rm $(docker volume ls -qf dangling=true | grep -x '.\{64\}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment