⚡ Only 300 spots remaining • Closes in 2d 14h 32m

Back to Workflow Library
Developer Tools

Docker Registry Image Cleanup

Automate Docker registry housekeeping. This weekly scheduled workflow queries your private Docker registry API, identifies dangling images or those older than 60 days, and runs deletion endpoints to save disk space.

#Docker
#Registry
#Cleanup
#Storage
#DevOps

Automation Logic

n8n JSON Blueprint

This workflow is pre-configured and ready for deployment. Simply import the JSON template into your n8n instance and configure your credentials.

This is an exclusive blueprint. Copy the JSON below to use it.

QUICK DEPLOY

  • 1
    Download the .json file
  • 2
    Open n8n & click "Import"
  • 3
    Configure your API keys

PRO TIP

Always test your workflow in a development environment before pushing to production.

JSON BLUEPRINT

n8n-workflow.json
{
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "value": 1
            }
          ]
        }
      },
      "name": "Weekly Cron",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [
        100,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://registry.hub.docker.com/v2/repositories/my-org/tags"
      },
      "name": "Fetch Image Tags",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        300,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const limit = new Date();\nlimit.setDate(limit.getDate() - 60);\nreturn items.filter(item => new Date(item.json.last_updated) < limit);"
      },
      "name": "Filter Old Images",
      "type": "n8n-nodes-base.code",
      "typeVersion": 1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "method": "DELETE",
        "url": "https://registry.hub.docker.com/v2/repositories/my-org/tags/{{$json.name}}"
      },
      "name": "Delete Image Tag",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        700,
        300
      ]
    }
  ],
  "connections": {
    "Weekly Cron": {
      "main": [
        [
          {
            "node": "Fetch Image Tags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Image Tags": {
      "main": [
        [
          {
            "node": "Filter Old Images",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Old Images": {
      "main": [
        [
          {
            "node": "Delete Image Tag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

To use this, copy the JSON above and paste it directly onto your n8n canvas.

IMPLEMENTATION GUIDE

Required Nodes

  • Docker Node
  • Registry Node
  • Cleanup Node
  • Storage Node
  • DevOps Node
  • Cron / Webhook Trigger

Core Benefits

  • 100% Automated Execution
  • Reduces Manual Data Entry
  • Infinite Scalability

Need Help Building Your Private Cloud?

Join the elite marketers who have offloaded their entire backend to n8n. Get direct support and custom builds in our private forum.

user