Who is this workflow for? This workflow automates the cleanup of outdated image tags in your Docker registry and executes garbage collection, ensuring your registry remains efficient and clutter-free without manual intervention..

What does this workflow do?

  • Retrieve Image Information: The workflow initiates by fetching a comprehensive list of all images and their associated tags from the Docker registry using the Registry v2 API.
  • Filter and Sort Tags: It then filters and sorts the retrieved tags based on criteria such as creation date and tag name, identifying which tags are eligible for removal.
  • Delete Old Tags: The workflow preserves the latest 10 tags for each image, including the ‘latest’ tag, and deletes the older, unused tags from the registry.
  • Send Notifications: Upon successful cleanup or in case of cancellation, the workflow sends email notifications to inform stakeholders about the status. It also notifies users in error conditions to prompt immediate attention.
  • Execute Garbage Collection: Finally, the workflow performs garbage collection on the Docker registry server via an SSH command, ensuring that all deleted tags are fully removed and storage is reclaimed.

🤖 Why Use This Automation Workflow?

  • Optimize Storage Usage: Automatically remove unused image tags, freeing up valuable storage space.
  • Maintain Registry Performance: Keep your Docker registry organized, enhancing performance and reliability.
  • Automate Routine Maintenance: Eliminate the need for manual cleanup tasks, saving time and reducing the risk of human error.

👨‍💻 Who is This Workflow For?

This workflow is ideal for DevOps engineers, system administrators, and development teams who manage Docker registries and seek to streamline maintenance processes to ensure efficient and orderly registry operations.

🎯 Use Cases

  1. Continuous Integration Pipelines: Automatically clean up old Docker images after each build, maintaining a lean and efficient registry.
  2. Resource-Constrained Environments: Manage storage effectively in environments with limited resources by regularly removing outdated image tags.
  3. Compliance and Organization: Ensure registry compliance by retaining only the necessary image versions, aiding in version control and auditing processes.

TL;DR

This n8n workflow provides a reliable and automated solution for managing Docker registries by cleaning up old image tags and performing necessary maintenance tasks. Implementing this workflow helps maintain an organized registry, optimizes storage usage, and reduces the administrative burden on your team.

Help us find the best n8n templates

About

A curated directory of the best n8n templates for workflow automations.