Skip to content

Instantly share code, notes, and snippets.

@enriquemanuel
Created August 23, 2017 19:27
Show Gist options
  • Save enriquemanuel/fd79073cb05cd0f5d447bd2b46579312 to your computer and use it in GitHub Desktop.
Save enriquemanuel/fd79073cb05cd0f5d447bd2b46579312 to your computer and use it in GitHub Desktop.
Bash commands for removing all docker images/containers
#!/bin/bash
# Remove all containers
docker rm $(docker ps -aq)
# Remove all exited containers
docker rm $(docker ps -aqf status=exited)
#!/bin/bash
# Remove all images
docker rmi $(docker images -q)
# Remove all untagged images
docker rmi $(docker images -qf dangling=true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment