Skip to content

Instantly share code, notes, and snippets.

@F21
Last active March 7, 2024 10:05
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save F21/f6614b8557768afbe8ed to your computer and use it in GitHub Desktop.
Save F21/f6614b8557768afbe8ed 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