⚙️ Docker registry cleanup workflow

3,743 views · ⚙️ DevOps & CI/CD

Description

Docker Registry Cleanup Template

This template is designed to automatically clean up old image tags in the Docker registry and perform garbage collection.

Features

Prerequisites

  1. Docker Registry v2 API access
  2. Basic Authentication credentials
  3. SMTP email settings (for notifications)
  4. SSH node installed on n8n (for garbage collection)

Installation

1. Identity Information

Add the following credentials in n8n:

2. Set Variables

Replace your-registry-url with your actual registry URL on all nodes:

‘url": ‘https://your.registry.com/v2/_catalog’.

Customisation

Retention Policy:

Set the number of tags to be retained by changing the slice(0, 10) value in the Identify Tags to Remove node

Schedule:

Change the frequency of operation at the Trigger node

Notification Content:

Customise email templates according to your needs

Notes

Step Details:

TL;DR

In summary, this n8n template provides a robust and automated solution for managing and cleaning up Docker registries. By regularly running this workflow, users can ensure that their registry remains organized and efficient, and avoid running out of storage space.-

🔗 Nodes Used

Send Email, HTTP Request, SSH, Schedule Trigger, Filter

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup