Webhook icon
Commands icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon

Enforce a Container Image Size Budget

Gate image rollout on a size budget and alert Slack on bloat.

Categories
CloudInfrastructureinfrastructure

Image bloat is invisible until deploys slow to a crawl. This blueprint pulls the image, reads its size, and alerts Slack when it exceeds your budget. Trigger it from your build pipeline.

How it works

  1. measure_size (io.kestra.plugin.scripts.shell.Commands on the docker CLI image) pulls the image and emits size in MB via the ::{"outputs": ...}:: protocol.
  2. over_budget (io.kestra.plugin.core.flow.If) branches: breach -> alert_oversize; pass -> log_ok.
  3. The errors block alerts on pull/inspect failure.
  4. Trigger: a Webhook.

What you get

  • A size budget enforced post-build.
  • Real numbers in every message.
  • Failure alerts for missing images.

Who it's for

  • Teams whose images grew 3x after one careless Dockerfile change.
  • Edge deployments where every MB matters.

Why orchestrate this with Kestra

docker inspect prints bytes; the flow makes it a gate with history and alerts. The next step (block the deploy, suggest a multi-stage fix, record a trend) is one task away.

Prerequisites

  • Docker available on the Kestra Worker.
  • A Slack webhook.

Secrets

  • SLACK_WEBHOOK_URL: webhook for breach and failure alerts.

Quick start

  1. Add the Slack webhook secret.
  2. Set image and max_size_mb.
  3. Run once and read image_size_mb.
  4. Wire the image-size webhook into your build pipeline.

How to extend

  • Fail the execution over budget for a hard gate.
  • Compare compressed vs uncompressed size.
  • Loop over many images with a ForEach.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.