Skip to content

Instantly share code, notes, and snippets.

@ericchin
ericchin / docker-cleanup-resources.md
Created February 19, 2019 16:42 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

{"liferay-20116":{"aliases":{},"mappings":{"SpellCheckDocumentType":{"dynamic_templates":[{"template_":{"mapping":{"index":"not_analyzed","omit_norms":"yes","type":"string","index_options":"docs"},"match":"*","match_mapping_type":"string"}},{"template_spellCheckWord":{"mapping":{"index":"analyzed","type":"string"},"match":"spellCheckWord_*","match_mapping_type":"string"}}],"properties":{"companyId":{"type":"string","index":"not_analyzed","store":true},"groupId":{"type":"string","index":"not_analyzed","store":true},"priority":{"type":"float"},"uid":{"type":"string","index":"not_analyzed","store":true}}},"KeywordQueryDocumentType":{"dynamic_templates":[{"template_":{"mapping":{"index":"not_analyzed","omit_norms":"yes","type":"string","index_options":"docs"},"match":"*","match_mapping_type":"string"}},{"template_keywordSearch":{"mapping":{"index":"analyzed","type":"string"},"match":"keywordSearch_*","match_mapping_type":"string"}}],"properties":{"companyId":{"type":"string","index":"not_analyzed","store":true},"