Skip to content

Instantly share code, notes, and snippets.

@regardfs
Forked from F21/cleanup-docker.md
Created June 29, 2017 10:33
Show Gist options
  • Save regardfs/755c2703f24b559c994ed8d929f55511 to your computer and use it in GitHub Desktop.
Save regardfs/755c2703f24b559c994ed8d929f55511 to your computer and use it in GitHub Desktop.
Commands to clean up docker

Remove dangling images

docker images -qf dangling=true | xargs docker rmi

Remove dangling volumes

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

Delete exited containers

docker rm `docker ps -aq`

Kill all running containers

docker kill `docker ps -aq`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment