Last active
August 22, 2022 13:45
-
-
Save carlos3g/c2a994b50e9c1f4e626c700fe79be84a to your computer and use it in GitHub Desktop.
delete all containers, images and volumes from docker
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 | |
# ------------------------------------------------------------------------------ | |
# author: Carlos Mesquita | |
# website: https://carlos3g.github.io | |
# ------------------------------------------------------------------------------ | |
# This script will: | |
# - Stop all docker containers | |
# - Delete all stopped docker containers | |
# - Delete all docker images | |
# - Delete all docker volumes | |
docker container stop $(docker ps -aq) | |
docker container rm $(docker ps -aq) | |
docker rmi $(docker images -q) | |
docker volume rm $(docker volume ls -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment