container-orchestration-patterns

Control Docker container lifecycles with resource limits, watchdog monitoring, and cleanup.

10|11|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/microsoft/amplifier-bundle-skills --skill container-orchestration-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: container-orchestration-patterns
Source: https://github.com/microsoft/amplifier-bundle-skills/tree/main/skills/container-orchestration-patterns
Command: npx skills add https://github.com/microsoft/amplifier-bundle-skills --skill container-orchestration-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you run task-specific work inside Docker containers without losing control of resource usage, cleanup, or long-running failures. It is designed for orchestration scenarios where isolated tasks may overconsume CPU, memory, or process counts, or leave orphaned containers behind after crashes and restarts.

Core Features & Use Cases

  • Container Safety Limits: Apply hard bounds for PIDs, memory, CPU, and lifetime so runaway jobs cannot exhaust the host.
  • Watchdog Monitoring: Continuously inspect active containers and terminate instances that exceed thresholds before they hit kernel-enforced limits.
  • Orphan Recovery and Cleanup: Preserve active instance tracking across restarts and destroy companion sidecars alongside the main workload.
  • Sidecar Provisioning: Spin up supporting services like databases or caches with bind-mounted persistent data for reproducible dev stacks.
  • Use Case: A developer runs many isolated build or test jobs in parallel and needs predictable cleanup, persistent local data, and protection against fork bombs or memory leaks.

Quick Start

Ask for a container orchestration pattern that creates a Docker-managed task runner with strict resource limits, watchdog cleanup, and optional sidecar support.

Frequently Asked Questions about container-orchestration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Docker container resource limits for CPU and memory?

Docker container resource limits are enforced by applying hard bounds for PIDs, memory, CPU, and lifetime so runaway jobs cannot exhaust the host system. Watchdog monitoring continuously inspects active containers and terminates instances exceeding thresholds.

How do I clean up orphaned Docker containers after a crash or restart?

Cleaning up orphaned Docker containers requires preserving active instance tracking across restarts and destroying companion sidecars alongside the main workload. Orphan recovery logic detects and removes leftover workloads after failures.

What is the best way to run sidecar services with persistent data in Docker?

Running sidecar services with persistent data in Docker involves provisioning supporting services like databases or caches with bind-mounted persistent data. This approach creates reproducible development stacks alongside the main workload.

Can I prevent fork bombs when running parallel isolated Docker tasks?

Preventing fork bombs when running parallel isolated Docker tasks requires applying hard bounds for PIDs. Watchdog monitoring continuously inspects active containers and destroys instances that exceed process count thresholds before host exhaustion.

Does container orchestration with watchdog monitoring work for reproducible dev stacks?

Container orchestration with watchdog monitoring works for reproducible dev stacks by combining strict resource limits, cleanup logic, and sidecar provisioning with bind-mounted persistent data. It ensures predictable cleanup and protection against memory leaks.

Why do my Docker containers keep exhausting host resources during long-running tasks?

Docker containers exhaust host resources when lacking hard bounds for PIDs, memory, CPU, and lifetime. Watchdog enforcement detects and destroys violating containers by continuously inspecting active instances and terminating them before hitting kernel-enforced limits.