Last active
May 5, 2023 12:47
-
-
Save obedparla/e3f91eb60cf692d893480d658b2add63 to your computer and use it in GitHub Desktop.
Completely clean Docker resources (images, network, volumes)
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
Note: These commands will remove all your Docker resources, not just the images. Be sure to backup any important data from your Docker volumes before running these commands. | |
bash | |
``` | |
# Stop all running Docker containers: | |
docker stop $(docker ps -aq) | |
# Remove all Docker containers: | |
docker rm $(docker ps -aq) | |
# Remove all Docker images: | |
docker rmi -f $(docker images -aq) | |
# Remove all Docker networks: | |
docker network prune -f | |
# Remove all Docker volumes: | |
docker volume prune -f | |
``` | |
Now, you can reinstall your Docker images. Using docker compose: `docker-compose up -d` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment