From 3e3b9ae47f258d13e048bcc4f8521df5cbc5bcef Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Mon, 2 Feb 2026 21:14:25 -0500 Subject: [PATCH] fix(update): pipe pull output through tail to prevent memory exhaustion Docker's /images/create API streams progress JSON for every layer. For large images, this can be gigabytes of output that was being buffered by curl and n8n, causing hangs and disk usage spikes. Now pipes through `tail -c 10000` to only keep the last 10KB where error/success messages appear. Discards the streaming progress data. Co-Authored-By: Claude Opus 4.5 --- n8n-workflow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n8n-workflow.json b/n8n-workflow.json index 56f641e..c0e0903 100644 --- a/n8n-workflow.json +++ b/n8n-workflow.json @@ -1564,7 +1564,7 @@ }, { "parameters": { - "jsCode": "// Build pull image command\nconst imageName = $json.imageName;\n\nreturn {\n json: {\n cmd: `curl -s --max-time 600 --unix-socket /var/run/docker.sock -X POST 'http://localhost/v1.47/images/create?fromImage=${encodeURIComponent(imageName)}'`,\n imageName,\n currentImageId: $json.currentImageId,\n currentVersion: $json.currentVersion,\n containerConfig: $json.containerConfig,\n hostConfig: $json.hostConfig,\n networkSettings: $json.networkSettings,\n containerName: $json.containerName,\n containerId: $json.containerId,\n chatId: $json.chatId\n }\n};" + "jsCode": "// Build pull image command\nconst imageName = $json.imageName;\n\n// Pipe through tail to only keep last 10KB - avoids memory issues with large pulls\n// Error/success messages appear at the end of the stream\nreturn {\n json: {\n cmd: `curl -s --max-time 600 --unix-socket /var/run/docker.sock -X POST 'http://localhost/v1.47/images/create?fromImage=${encodeURIComponent(imageName)}' | tail -c 10000`,\n imageName,\n currentImageId: $json.currentImageId,\n currentVersion: $json.currentVersion,\n containerConfig: $json.containerConfig,\n hostConfig: $json.hostConfig,\n networkSettings: $json.networkSettings,\n containerName: $json.containerName,\n containerId: $json.containerId,\n chatId: $json.chatId\n }\n};" }, "id": "code-build-pull-cmd", "name": "Build Pull Command",