-
-
Save bolavefasfas/a2d9b75a2eecf9d50957194d2c36c4a3 to your computer and use it in GitHub Desktop.
docker clean up stopped containers and remove unlinked images
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
#!/usr/bin/sh | |
# info | |
docker system df # Show docker disk usage, including space reclaimable by pruning | |
# automatic clean up | |
docker system prune # will delete ALL unused data | |
# (i.e. In order: containers stopped, volumes without containers and images with no containers) | |
# manual clean up | |
docker container prune # Remove all stopped containers | |
docker volume prune # Remove all unused volumes | |
docker image prune # Remove unused images | |
docker system prune # All of the above, in this order: containers, volumes, images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment