Last active
December 12, 2018 10:54
-
-
Save mchoplin/2f25220625963db3b1e5eb78da8623cd to your computer and use it in GitHub Desktop.
remove_docker_containers_and_images.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Stop all docker containers | |
docker container stop $(docker container ls -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) | |
# Remove the volumes (--volumes), any unused images (--all), as well as override the confirmation prompt (--force) | |
docker system prune -a -f --volumes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment