From 4863f44c6e36ddc61ec723954ec7daf8ae7d8a2e Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Wed, 6 Aug 2025 10:41:09 -0600 Subject: [PATCH] Add Docker cleanup script and update README - Introduced a new script, docker_cleanup.sh, for cleaning up unused Docker containers, images, and volumes to free up disk space. - Updated README.md to include instructions for using the Docker cleanup script, emphasizing its utility and caution regarding data removal. --- README.md | 10 ++++++++++ scripts/docker_cleanup.sh | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 scripts/docker_cleanup.sh diff --git a/README.md b/README.md index 91c030e..829d36c 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,16 @@ This script will: 4. Ask if you want to re-run the n8n workflow import (useful if you skipped this during the initial installation or want to refresh the community workflows). 5. Restart all services with the new updates. +## Cleaning up Docker + +If you need to free up disk space, you can run the Docker cleanup script. This script removes all unused Docker containers, images, and volumes. + +```bash +sudo bash ./scripts/docker_cleanup.sh +``` + +This can be useful for removing old images and freeing up space, but be aware that it will remove all unused data. + ## Important Links - Based on a project by [coleam00](https://github.com/coleam00/local-ai-packaged) diff --git a/scripts/docker_cleanup.sh b/scripts/docker_cleanup.sh new file mode 100755 index 0000000..11b9114 --- /dev/null +++ b/scripts/docker_cleanup.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# This script is intended for cleaning up the Docker system. +# It removes all unused containers, images, networks, and volumes. +# Use with caution, as this action is irreversible. + +echo "Starting Docker cleanup..." + +# The 'docker system prune' command removes: +# - all stopped containers +# - all networks not used by at least one container +# - all "dangling" (unreferenced) images +# - all build cache +# +# Additional flags: +# -a, --all: Remove all unused images, not just dangling ones. +# --volumes: Remove all unused volumes. +# -f, --force: Do not prompt for confirmation. + +docker system prune -a --volumes -f + +echo "Docker cleanup completed successfully." +