Forked from weblancaster/gist:6e7f43fc02725ce747e224b0c4290906
Last active
February 19, 2025 02:33
-
-
Save rabbitcannon/1737322ea4a6b602e61a29ed689e04ca to your computer and use it in GitHub Desktop.
Kill all container, remove all images and stop all containers
This file contains hidden or 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
| ### You need to kill docker on mac because it's erroring and won't go away? | |
| killall Docker | |
| #stop all containers: | |
| docker kill $(docker ps -q) | |
| #remove all containers | |
| docker rm $(docker ps -a -q) | |
| #kill and remove all containers | |
| docker kill $(docker ps -q) && docker rm $(docker ps -a -q) | |
| docker system prune -a -f --volumes | |
| #remove all docker images | |
| docker rmi $(docker images -q) | |
| #build image without cache | |
| docker build --no-cache | |
| # Docker down and remove volumes | |
| docker-compose down -v | |
| # Rebuild image without cache | |
| docker-compose build --no-cache | |
| # docker destroy,....everything(except your volumes)! | |
| docker system prune -a | |
| # docker reclaim space on volumes | |
| docker volume prune | |
| # get docker container IPs | |
| docker inspect CONTAINER_NAME --format '{{ .NetworkSettings.IPAddress }}' | |
| # SSH onto container | |
| docker exec -it CONTAINER_NAME bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment