Unverified Commit 8993073d authored by QiliangCui's avatar QiliangCui Committed by GitHub
Browse files

[CI] Delete images older than 24h. (#23291)


Signed-off-by: default avatarQiliang Cui <derrhein@gmail.com>
parent 655a09f6
...@@ -17,7 +17,7 @@ if [ "$disk_usage" -gt "$threshold" ]; then ...@@ -17,7 +17,7 @@ if [ "$disk_usage" -gt "$threshold" ]; then
# Remove dangling images (those that are not tagged and not used by any container) # Remove dangling images (those that are not tagged and not used by any container)
docker image prune -f docker image prune -f
# Remove unused volumes / force the system prune for old images as well. # Remove unused volumes / force the system prune for old images as well.
docker volume prune -f && docker system prune --force --filter "until=72h" --all docker volume prune -f && docker system prune --force --filter "until=24h" --all
echo "Docker images and volumes cleanup completed." echo "Docker images and volumes cleanup completed."
else else
echo "Disk usage is below $threshold%. No cleanup needed." echo "Disk usage is below $threshold%. No cleanup needed."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment