Docker 레지스터리 정리 워크플로우
고급
이것은Engineering, DevOps, IT Ops분야의자동화 워크플로우로, 16개의 노드를 포함합니다.주로 Set, Ssh, Code, Sort, Filter 등의 노드를 사용하며. Docker 레지스터리 클리닝 워크플로우
사전 요구사항
- •대상 API의 인증 정보가 필요할 수 있음
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
"nodes": [
{
"id": "6b1865a7-f150-4d2b-b1f7-37c68b2173d6",
"name": "매니페스트 다이제스트 가져오기",
"type": "n8n-nodes-base.httpRequest",
"position": [
920,
-300
],
"parameters": {
"url": "={{\"https://<<your-registry-url>>/v2/\" + $json.name + \"/manifests/\" + $json.tag}}",
"options": {
"fullResponse": true
},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"headerParametersUi": {
"parameter": [
{
"name": "Accept",
"value": "application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json"
}
]
}
},
"typeVersion": 2
},
{
"id": "3c1daca9-3897-4596-b62d-db561f8cb047",
"name": "오래된 태그 제거",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
840,
-40
],
"parameters": {
"url": "={{\"https://<<your-registry-url>>/v2/\" + $json.image + \"/manifests/\" + $json.tag.digest}}",
"options": {},
"requestMethod": "DELETE",
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"headerParametersUi": {
"parameter": [
{
"name": "Accept",
"value": "application/vnd.docker.distribution.manifest.v2+json"
}
]
}
},
"typeVersion": 2
},
{
"id": "6974749e-8c85-4334-a7e7-e964f057ed6f",
"name": "이미지 태그 검색",
"type": "n8n-nodes-base.httpRequest",
"position": [
400,
-300
],
"parameters": {
"url": "={{\"https://<<your-registry-url>>/v2/\" + $json[\"image\"] + \"/tags/list\"}}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"headerParametersUi": {
"parameter": [
{
"name": "Accept",
"value": "application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, application/vnd.docker.distribution.manifest.list.v2+json"
}
]
}
},
"typeVersion": 2
},
{
"id": "30857c32-508e-4f95-8e26-c9f2fc84e074",
"name": "이미지 목록 조회",
"type": "n8n-nodes-base.httpRequest",
"position": [
40,
-300
],
"parameters": {
"url": "https://<<your-registry-url>>/v2/_catalog",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"typeVersion": 2
},
{
"id": "c5965a6a-28e6-4217-a846-a849de153430",
"name": "이미지 이름 추출",
"type": "n8n-nodes-base.code",
"position": [
220,
-300
],
"parameters": {
"jsCode": "const images = items[0].json.repositories;\nreturn images.map(image => ({ json: { image } }));"
},
"typeVersion": 2
},
{
"id": "b13eb6e5-1a16-4992-b0bd-9b228559fecf",
"name": "제거 대상 태그 식별",
"type": "n8n-nodes-base.code",
"position": [
600,
-40
],
"parameters": {
"jsCode": "const result = [];\n\nfor (const item of items) {\n const tags = item.json.tags;\n if (tags) {\n const latestTag = tags.includes('latest') ? 'latest' : null;\n const sortedTags = tags.filter(tag => tag !== 'latest')\n .sort((a, b) => new Date(b.created) - new Date(a.created));\n const keepTags = sortedTags.slice(0, 10);\n if (latestTag) keepTags.push('latest');\n const deleteTags = sortedTags.slice(10);\n result.push(...deleteTags.map(tag => ({ json: { image: item.json.name, tag } })));\n }\n}\n\nreturn result;\n"
},
"typeVersion": 2
},
{
"id": "da15ae49-09ee-4658-86a5-9b0a2180c637",
"name": "예약 트리거",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-140,
-300
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 1
}
]
}
},
"typeVersion": 1.2
},
{
"id": "bcc347be-5520-46c0-aac9-0b14ddd8b184",
"name": "알림 이메일 전송",
"type": "n8n-nodes-base.emailSend",
"position": [
840,
180
],
"webhookId": "47f852c3-7136-4e6d-92f6-47322dbba5da",
"parameters": {
"text": "=Image : {{ $json.image }}\nTag : {{ $json.tag.tag }}\n\nRemoved",
"options": {},
"subject": "Docker Registry Cleaner Notification",
"toEmail": "to@example.com",
"fromEmail": "from@example.com",
"emailFormat": "text"
},
"typeVersion": 2.1
},
{
"id": "2c3770ef-cb4c-4007-8897-f4eb7ad3b7cf",
"name": "태그 분할",
"type": "n8n-nodes-base.splitOut",
"position": [
580,
-300
],
"parameters": {
"include": "selectedOtherFields",
"options": {
"destinationFieldName": "tag"
},
"fieldToSplitOut": "tags",
"fieldsToInclude": "name"
},
"typeVersion": 1
},
{
"id": "4fffa947-02cf-4608-acab-8284250cf622",
"name": "유효한 태그 필터링",
"type": "n8n-nodes-base.filter",
"position": [
740,
-300
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bb56b84e-e7cb-4867-93f8-ac40c71bde4f",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.tag }}",
"rightValue": ""
},
{
"id": "acd8e00c-5fa0-4c62-ba96-9e6f456f7703",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.name }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "c023ba14-d12d-497c-9b30-97db04a34c1b",
"name": "Blob용 매니페스트 다이제스트 가져오기",
"type": "n8n-nodes-base.httpRequest",
"position": [
-120,
-40
],
"parameters": {
"url": "={{\"https://<<your-registry-url>>/v2/\" + $('Filter Valid Tags').item.json.name + \"/blobs/\" + $json.body.config.digest}}",
"options": {
"fullResponse": false
},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"headerParametersUi": {
"parameter": [
{
"name": "Accept",
"value": "application/vnd.docker.distribution.manifest.v2+json"
}
]
}
},
"typeVersion": 2
},
{
"id": "f054b91e-abd4-4854-9bfa-e4a2b70f7e2c",
"name": "필드 업데이트",
"type": "n8n-nodes-base.set",
"position": [
60,
-40
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c970bdb8-ddbf-486b-a716-c66274a248a7",
"name": "name",
"type": "string",
"value": "={{ $('Filter Valid Tags').item.json.name }}"
},
{
"id": "7ce79761-6557-413c-a9a6-5d1ca564a3df",
"name": "tag",
"type": "string",
"value": "={{ $('Filter Valid Tags').item.json.tag }}"
},
{
"id": "45948a25-d35c-4e3f-9556-3d52a1a89f80",
"name": "created",
"type": "string",
"value": "={{ $json.created }}"
},
{
"id": "c73a14ad-91f6-477f-b4c3-037db319b9ee",
"name": "digest",
"type": "string",
"value": "={{ $('Fetch Manifest Digest').item.json.headers['docker-content-digest'] }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "54405505-8445-491a-8f5d-232da8c842d2",
"name": "이미지별 태그 그룹화",
"type": "n8n-nodes-base.code",
"position": [
420,
-40
],
"parameters": {
"jsCode": "const groupedData = items.reduce((acc, item) => {\n const name = item.json.name;\n if (!acc[name]) {\n acc[name] = [];\n }\n acc[name].push({\n tag: item.json.tag,\n created: item.json.created,\n digest: item.json.digest\n });\n return acc;\n}, {});\n\nreturn Object.keys(groupedData).map(name => ({\n json: { name, tags: groupedData[name] }\n}));\n"
},
"typeVersion": 2
},
{
"id": "980aab86-44cd-47d5-b3b7-42cbae26eb09",
"name": "생성 날짜별 정렬",
"type": "n8n-nodes-base.sort",
"position": [
240,
-40
],
"parameters": {
"options": {},
"sortFieldsUi": {
"sortField": [
{
"order": "descending",
"fieldName": "created"
}
]
}
},
"typeVersion": 1
},
{
"id": "0561efb9-4903-4bec-bc1a-8131e5f5de67",
"name": "실패 알림 이메일 전송",
"type": "n8n-nodes-base.emailSend",
"position": [
1120,
80
],
"webhookId": "47f852c3-7136-4e6d-92f6-47322dbba5da",
"parameters": {
"text": "=Image : {{ $json.image }}\nTag : {{ $json.tag.tag }}\n\nFailed",
"options": {},
"subject": "[FAIL] Docker Registry Cleaner Notification",
"toEmail": "to@example.com",
"fromEmail": "from@example.com",
"emailFormat": "text"
},
"typeVersion": 2.1
},
{
"id": "eaa28914-351c-4934-ba1c-0d39faf67ef3",
"name": "가비지 컬렉션 실행",
"type": "n8n-nodes-base.ssh",
"position": [
1120,
-100
],
"parameters": {
"cwd": "/opt/services/",
"command": "docker compose exec -it -u root registry bin/registry garbage-collect --delete-untagged /etc/docker/registry/config.yml",
"authentication": "privateKey"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"2c3770ef-cb4c-4007-8897-f4eb7ad3b7cf": {
"main": [
[
{
"node": "4fffa947-02cf-4608-acab-8284250cf622",
"type": "main",
"index": 0
}
]
]
},
"30857c32-508e-4f95-8e26-c9f2fc84e074": {
"main": [
[
{
"node": "c5965a6a-28e6-4217-a846-a849de153430",
"type": "main",
"index": 0
}
]
]
},
"f054b91e-abd4-4854-9bfa-e4a2b70f7e2c": {
"main": [
[
{
"node": "980aab86-44cd-47d5-b3b7-42cbae26eb09",
"type": "main",
"index": 0
}
]
]
},
"3c1daca9-3897-4596-b62d-db561f8cb047": {
"main": [
[
{
"node": "eaa28914-351c-4934-ba1c-0d39faf67ef3",
"type": "main",
"index": 0
}
],
[
{
"node": "0561efb9-4903-4bec-bc1a-8131e5f5de67",
"type": "main",
"index": 0
}
]
]
},
"4fffa947-02cf-4608-acab-8284250cf622": {
"main": [
[
{
"node": "6b1865a7-f150-4d2b-b1f7-37c68b2173d6",
"type": "main",
"index": 0
}
]
]
},
"da15ae49-09ee-4658-86a5-9b0a2180c637": {
"main": [
[
{
"node": "30857c32-508e-4f95-8e26-c9f2fc84e074",
"type": "main",
"index": 0
}
]
]
},
"c5965a6a-28e6-4217-a846-a849de153430": {
"main": [
[
{
"node": "6974749e-8c85-4334-a7e7-e964f057ed6f",
"type": "main",
"index": 0
}
]
]
},
"54405505-8445-491a-8f5d-232da8c842d2": {
"main": [
[
{
"node": "b13eb6e5-1a16-4992-b0bd-9b228559fecf",
"type": "main",
"index": 0
}
]
]
},
"6974749e-8c85-4334-a7e7-e964f057ed6f": {
"main": [
[
{
"node": "2c3770ef-cb4c-4007-8897-f4eb7ad3b7cf",
"type": "main",
"index": 0
}
]
]
},
"6b1865a7-f150-4d2b-b1f7-37c68b2173d6": {
"main": [
[
{
"node": "c023ba14-d12d-497c-9b30-97db04a34c1b",
"type": "main",
"index": 0
}
]
]
},
"980aab86-44cd-47d5-b3b7-42cbae26eb09": {
"main": [
[
{
"node": "54405505-8445-491a-8f5d-232da8c842d2",
"type": "main",
"index": 0
}
]
]
},
"b13eb6e5-1a16-4992-b0bd-9b228559fecf": {
"main": [
[
{
"node": "3c1daca9-3897-4596-b62d-db561f8cb047",
"type": "main",
"index": 0
},
{
"node": "bcc347be-5520-46c0-aac9-0b14ddd8b184",
"type": "main",
"index": 0
}
]
]
},
"c023ba14-d12d-497c-9b30-97db04a34c1b": {
"main": [
[
{
"node": "f054b91e-abd4-4854-9bfa-e4a2b70f7e2c",
"type": "main",
"index": 0
}
]
]
}
}
}자주 묻는 질문
이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
고급 - 엔지니어링, 데브옵스, IT 운영
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
GPT-4.1, Outlook 및 Mem.ai를 사용한 Microsoft Teams 회의 분석 자동화
GPT-4.1, Outlook 및 Mem.ai를 사용한 자동화된 Microsoft Teams 회의 분석
If
Set
Code
+
If
Set
Code
61 노드Wayne Simpson
인사
모든 Scaleway 서버 정보 복사본 가져오기
동적 필터를 사용하여 Scaleway 서버 정보를 가져옵니다.
If
Set
Code
+
If
Set
Code
24 노드Pablo
엔지니어링
GitHub 동기화 대시보드 - V2
提交 기록과 롤백 기능을 갖춘 GitHub 워크플로우 버전 관리 대시보드
If
N8n
Set
+
If
N8n
Set
94 노드Eduard
데브옵스
RSS와 GPT-4o를 사용하여 일일 이스라엘 경제 뉴스 브리핑 생성
RSS와 GPT-4o를 사용하여 매일 이스라엘 경제 뉴스 요약을 생성하세요
Set
Code
Html
+
Set
Code
Html
23 노드Elay Guez
금융
n8n과 API를 사용한 GitLab 병합 요청 자동화
n8n와 API를 사용한 GitLab 병합 요청 자동화
If
Set
Wait
+
If
Set
Wait
10 노드Aditya Gaur
엔지니어링
n8n 업데이트
Telegram 승인 시스템을 사용한 Docker 컨테이너 업데이트 자동화
If
Set
Ssh
+
If
Set
Ssh
27 노드Jaber Zare
데브옵스