{"product_id":"update-docker-containers-by-image-digest-via-docker-api","title":"Update Docker Containers by Image Digest via Docker API","description":"\u003ch3\u003eAutomatically update your Docker container when the image digest changes\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow runs hourly to detect updated Docker image digests via the Docker Registry API, then pulls the new image and recreates your container—waiting for health checks before confirming success or alerting if unhealthy.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns every hour\u003c\/strong\u003e on a schedule.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLoads configuration\u003c\/strong\u003e (target container name, image reference, and host\/container port mapping) from a central “Settings” step.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eInspects digests\u003c\/strong\u003e using the Docker Registry API to read the currently published image manifest digest, then compares it to the digest of the same image inspected locally.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDecides whether an update is needed\u003c\/strong\u003e by comparing the published digest vs. the local image digest.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates safely when changed:\u003c\/strong\u003e pulls the latest image, removes the existing container, and creates a new container using the configured port mapping, with a health check and restart policy.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWaits for health:\u003c\/strong\u003e monitors the new container until it becomes \u003cem\u003ehealthy\u003c\/em\u003e or until a \u003cstrong\u003e120-second\u003c\/strong\u003e timeout occurs.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRoutes outcomes:\u003c\/strong\u003e ends at a success placeholder if healthy, or an unhealthy-alert placeholder if not.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNo change when up to date:\u003c\/strong\u003e if digests match, the workflow ends without modifying containers.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eKeep a production or staging service current \u003cstrong\u003ewithout manual redeploys\u003c\/strong\u003e, based on Docker image digest changes.\u003c\/li\u003e\n  \u003cli\u003eImprove reliability by \u003cstrong\u003erecreating containers only when a new digest is published\u003c\/strong\u003e and confirming readiness via health checks.\u003c\/li\u003e\n  \u003cli\u003eRun digest-aware maintenance for SaaS environments where consistent container health matters.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDocker API integration:\u003c\/strong\u003e uses \u003ccode\u003en8n-nodes-docker-apidocker\u003c\/code\u003e to inspect images and manage containers on your Docker host.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCore logic nodes:\u003c\/strong\u003e \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, and \u003ccode\u003eno op\u003c\/code\u003e, plus \u003ccode\u003esticky note\u003c\/code\u003e for workflow clarity.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHealth check compatibility:\u003c\/strong\u003e the workflow assumes a health check command that defaults to \u003ccode\u003ewget\u003c\/code\u003e against \u003ccode\u003ehttp:\/\/localhost:\u0026lt;containerPort\u0026gt;\/\u003c\/code\u003e—adjust it to match your application endpoint.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45755361099955,"sku":"N8N-17731","price":68.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/516jEnytRdHp2tXrrj37s_Y7lk5LcF.png?v=1785661414","url":"https:\/\/buyflowscripts.com\/products\/update-docker-containers-by-image-digest-via-docker-api","provider":"N8N Commerce","version":"1.0","type":"link"}