Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🧹 chore: Prune Dangling Images After deployed-update Pull (#14269)

Danny Avila481e2a9257db
diff --git a/config/deployed-update.js b/config/deployed-update.js
index 7ce6eb106d..57434e54bf 100644
--- a/config/deployed-update.js
+++ b/config/deployed-update.js
@@ -61,6 +61,15 @@ const shouldRebase = process.argv.includes('--rebase');
console.orange(pullCommand);
execSync(pullCommand, { stdio: 'inherit' });
+ /* The tag-removal above only covers the stock repositories; any overridden
+ * `api` image (or other freshly pulled service) leaves its previous version
+ * dangling — ~1.7GB per update that nothing reclaimed. Prune AFTER the pull
+ * so the just-superseded layers are already untagged, mirroring update.js. */
+ console.purple('Removing all unused dangling Docker images...');
+ const pruneCommand = 'sudo docker image prune -f';
+ console.orange(pruneCommand);
+ execSync(pruneCommand, { stdio: 'inherit' });
+
const startCommand = 'sudo docker compose -f ./deploy-compose.yml up -d';
console.green('Your LibreChat app is now up to date! Start the app with the following command:');
console.purple(startCommand);